Module: Mesa Branch: master Commit: 8080082ad7823dc6baa43f0fb4935ae02e6f09e0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8080082ad7823dc6baa43f0fb4935ae02e6f09e0
Author: Samuel Pitoiset <[email protected]> Date: Mon May 15 12:55:05 2017 +0200 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]> --- src/mesa/main/uniform_query.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 979bd0dc46..16e3fe3d52 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; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
