diff options
author | marha <marha@users.sourceforge.net> | 2011-11-17 16:37:26 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-17 16:37:26 +0100 |
commit | d41bc08d1ae8c4784c09d8977816c0fadab1ba52 (patch) | |
tree | 4dc3081a9af0316eeee02356a44fcc2419e1b15e /mesalib/src/mesa/main/uniform_query.cpp | |
parent | 156e37d3879b316329e3e05579414031da2647e2 (diff) | |
download | vcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.tar.gz vcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.tar.bz2 vcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.zip |
xserver mesa git update 17 nov 2011
Diffstat (limited to 'mesalib/src/mesa/main/uniform_query.cpp')
-rw-r--r-- | mesalib/src/mesa/main/uniform_query.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp index 5371d6a17..33ba53c2e 100644 --- a/mesalib/src/mesa/main/uniform_query.cpp +++ b/mesalib/src/mesa/main/uniform_query.cpp @@ -698,11 +698,27 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, prog = shProg->_LinkedShaders[i]->Program; + /* If the shader stage doesn't use any samplers, don't bother + * checking if any samplers have changed. + */ + if (prog->SamplersUsed == 0) + continue; + assert(sizeof(prog->SamplerUnits) == sizeof(shProg->SamplerUnits)); - if (memcmp(prog->SamplerUnits, - shProg->SamplerUnits, - sizeof(shProg->SamplerUnits)) != 0) { + /* Determine if any of the samplers used by this shader stage have + * been modified. + */ + bool changed = false; + for (unsigned j = 0; j < Elements(prog->SamplerUnits); j++) { + if ((prog->SamplersUsed & (1U << j)) != 0 + && (prog->SamplerUnits[j] != shProg->SamplerUnits[j])) { + changed = true; + break; + } + } + + if (changed) { if (!flushed) { FLUSH_VERTICES(ctx, _NEW_TEXTURE | _NEW_PROGRAM); flushed = true; |