+ shProg = _mesa_lookup_shader_program_err(ctx, program,
+ "glShaderStorageBlockBinding");
+ if (!shProg)
+ return;
+
+ if (shaderStorageBlockIndex >= shProg->data->NumShaderStorageBlocks) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glShaderStorageBlockBinding(block index %u >= %u)",
+ shaderStorageBlockIndex,
+ shProg->data->NumShaderStorageBlocks);
+ return;
+ }
+
+ if (shaderStorageBlockBinding >= ctx->Const.MaxShaderStorageBufferBindings) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glShaderStorageBlockBinding(block binding %u >= %u)",
+ shaderStorageBlockBinding,
+ ctx->Const.MaxShaderStorageBufferBindings);
+ return;
+ }
+
+ if (shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding !=
+ shaderStorageBlockBinding) {
+
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewShaderStorageBuffer;
+
+ shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding =
+ shaderStorageBlockBinding;
+ }
+}