summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-15 12:55:05 +0200
committerSamuel Pitoiset <[email protected]>2017-05-16 09:33:04 +0200
commit8080082ad7823dc6baa43f0fb4935ae02e6f09e0 (patch)
tree3907755c4fc2a644ac6e2233c84eefa711ead971 /src
parent3c95a4fd4c50261b8c0c9d878e9f4f8dce571220 (diff)
mesa: unify _mesa_uniform() for image uniforms
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/uniform_query.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 979bd0dc461..16e3fe3d527 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1018,13 +1018,15 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
*/
if (uni->type->is_image()) {
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
- if (uni->opaque[i].active) {
- struct gl_linked_shader *sh = shProg->_LinkedShaders[i];
+ struct gl_linked_shader *sh = shProg->_LinkedShaders[i];
- for (int j = 0; j < count; j++)
- sh->Program->sh.ImageUnits[uni->opaque[i].index + offset + j] =
- ((GLint *) values)[j];
- }
+ /* If the shader stage doesn't use the image uniform, skip this. */
+ if (!uni->opaque[i].active)
+ continue;
+
+ for (int j = 0; j < count; j++)
+ sh->Program->sh.ImageUnits[uni->opaque[i].index + offset + j] =
+ ((GLint *) values)[j];
}
ctx->NewDriverState |= ctx->DriverFlags.NewImageUnits;