View Full Version : [NV 310.90] compute shader reads zero from texture

01-11-2013, 11:10 AM
Hi there,

I postet this bug in september or october already... it was said to be fixed in some 306.x driver.
The problem: my compute shader sometimes reads 0 from a texture.
There was some not so nice workaround that I unfortunately do not remember anymore.
Please confirm and, of course, fix this (it's causing huge headaches, because most textures work and suddenly one is not...).

Thank you.

01-11-2013, 01:24 PM
As far as I know bug has been fixed. Every texture lookup I perform works for me. What is your usage scenario that does not work?

01-12-2013, 02:31 AM
I converted my compute shader into a fragment shader + framebuffer etc. and it works.
I can only sketch my pipeline...
I have a class, holding some texture, let's call it xxxSample with { Texture2D color; Texture2D weight }.
I create a sample object (means I create the textures, make them immutable, etc.). I clear the weight texture with 0. I write data to a sample in a compute program, but potentially only partially (that's why I clear the weight texture) -> here everything seams to work.
I do this again for another sample object.
Now, I need to "merge" these objects. So, I pass all the textures to the compute program, something like:
unsigned int texUnit = 0;
for(size_t i=0; i<inputSamples_.size(); ++i) {
And here, the reads fails for texture units 3,4,5.
I am pretty convinced, that it is this bug, because: I can dump my textures, they have data. I can switch the order of the samples (sample[1] binds to tex units 0,1,2, sample[0] to 3,4,5) and it does not work. But most important, it works for a fragment shader!
I am not sure, if this gives you a clue in any means... maybe you can ask more specific questions about my textures, programs or something? (I cannot post all the code here).
More information on my environment: I am using only immutable textures, DSA, 430 shaders with the bindings specified in the shader.
card: 560Ti or quadro 2000m

01-30-2013, 01:10 AM
is there any update on this?
can you confirm the problem?
I would really like to switch to compute shaders in many cases and avoid the framebuffer, quad, ... stuff, but this bug was driving me crazy a couple of times now.

01-30-2013, 01:55 AM
Without seeing the source code is really hard to guess what's going wrong. Did you add calls to glMemoryBarrier() at the appropriate places?