I stumbled upon this bug(?) a couple of times by now:
- create a texture, make it immutable
- upload data from cpu to the texture
- bind texture to some texture unit (not image unit - actually, I haven’t tested that)
- run compute shader
-> read some data from that texture
Result: read is always 0.
If I use the same texture in some program in an old compute shader fashion (quad; vertex/fragment shader), it works.
If - between step 2 and 4 - the texture is read by some fragment shader, the compute program IS able to read data from the texture.
Some more hints about my application (although it shouldn’t matter)
- I have a small OpenGL library, which wraps most of the OpenGL “objects”… so no code here.
- I use DSA (I just like OOP thinking)
- Am I correct that the 305.67 is still the only driver supporting OpenGL 4.3? I tried the others and (although the nvidia page partially says differently) they do not give me an 4.3 context (card: 560ti).
I just tried the new driver 306.63 and it behaves the same :(.
Furthermore I ran into an example, where even the trick with first using the texture in a fragment shader does not help, the compute shader always reads 0. I tried the “same” shader as a fragment shader with framebuffers etc. and it there it works as expected.