Skip to main content
gamedev.net
🔒 Locked

Texture data

Started by kayX Dec 21, 2005 at 11:08 PM 1 replies 550+ views
Original Post
kayX
kayX
Hi everyone. As i understand, texture has a block of memory where it keeps its pixel data. Is it possible for me to associate this blick of memory to a block of system memory that i allocate myself? In this way, i can update its data like a normal byte array and the changed will be mirrored and vice versa. What i'm trying to do is to do image processing using hardware and software together. Any help would be appreciated. thanks
kayX
kayX
thanks for the speedy reply.
Yes i am using DirectX9. I know how to created texture and by specifying the D3DPOOL, i am able to create the texture either on system or video ram.

But what i would like to do is to allocated a block of memory, somehow assign this memory to the texture so that it would use this for its data while maintaining a pointer to the memory as long as i want. This is so that i could do some per pixel operation on it using hardware and then use the result with other software processing or possibly saving it as byte arrays. If i am able to work on the same memory block the texture is using, i would eliminate the need to copy it to another block of memory.

Another reason why i would not want to use lock is so that my other software processing can just get a pointer and work with it. Though i can always lock it and use the returned address as a parameter, operation that work in a pattern such as hardware->software->hardware->software... etc will require a lot of locking and unlocking. I'm afraid that the overhead of the locking will kill my app performance.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.