1
votes

I've have a rendering setup in which I write to a Frame Buffer object attached to a texture and the rendering itself also uses the texture I'm rendering to.
Is this generally a good idea? Could there be some strange issues involved here I'm perhaps not aware of?

1

1 Answers

4
votes

This will result in undefined behavior, which means it may break with any future driver version, and behave differently on different hardware. To be on the safe side, you should never render into a texture which is currently bound (i.e. which could be possibly read and written to at the same time -- this is the problem actually). Try making a copy of the texture, and render into that instead.

Take a look at the spec, specifially section 4.4.3 "Rendering When an Image of a Bound Texture Object is Also Attached to the Framebuffer"