Getting GPU texture data to CPU
I'm using glTexSubImage2D a lot to update a texture in a component. For testing purposes, it would be quite handy to be able to retrieve the texture data from the GPU to perform checks at any time that the data loaded into it is correct. Is there any way of doing this in OpenGL?
Take a look at the OpenGL reference pages.
Unfortunately it seems you can only retrieve the whole texture and not just a part of it. A workaround would be to render the texture to the framebuffer or bind it to a framebuffer object, set the read buffer correctly and then read it with glReadPixels.
Unfortunately it seems you can only retrieve the whole texture and not just a part of it. A workaround would be to render the texture to the framebuffer or bind it to a framebuffer object, set the read buffer correctly and then read it with glReadPixels.
It better to use GLintercept for debugging. If you have any questions on how to use, ask away.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement