aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/uniform_query.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-17 16:37:26 +0100
committermarha <marha@users.sourceforge.net>2011-11-17 16:37:26 +0100
commitd41bc08d1ae8c4784c09d8977816c0fadab1ba52 (patch)
tree4dc3081a9af0316eeee02356a44fcc2419e1b15e /mesalib/src/mesa/main/uniform_query.cpp
parent156e37d3879b316329e3e05579414031da2647e2 (diff)
downloadvcxsrv-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.cpp22
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;