Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com> --- 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 586b92d2eb..6aba8ace0e 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -1009,13 +1009,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; -- 2.13.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev