summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-26 15:31:28 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-28 10:25:13 +0200
commitedd50828618ed2efe799013c2723d67c407d86b4 (patch)
tree7af7066958c622ee3834355ca4cecc9b73029129 /src/mesa
parent6a2c1e76f2a51ec19306360c1ee6711487bde5cb (diff)
mesa: add shader_storage_block_binding() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/uniforms.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index a71e0695b05..28f530c4f68 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -1145,6 +1145,23 @@ _mesa_UniformBlockBinding(GLuint program,
uniform_block_binding(ctx, shProg, uniformBlockIndex, uniformBlockBinding);
}
+static void
+shader_storage_block_binding(struct gl_context *ctx,
+ struct gl_shader_program *shProg,
+ GLuint shaderStorageBlockIndex,
+ GLuint shaderStorageBlockBinding)
+{
+ if (shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding !=
+ shaderStorageBlockBinding) {
+
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewShaderStorageBuffer;
+
+ shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding =
+ shaderStorageBlockBinding;
+ }
+}
+
void GLAPIENTRY
_mesa_ShaderStorageBlockBinding(GLuint program,
GLuint shaderStorageBlockIndex,
@@ -1179,15 +1196,8 @@ _mesa_ShaderStorageBlockBinding(GLuint program,
return;
}
- if (shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding !=
- shaderStorageBlockBinding) {
-
- FLUSH_VERTICES(ctx, 0);
- ctx->NewDriverState |= ctx->DriverFlags.NewShaderStorageBuffer;
-
- shProg->data->ShaderStorageBlocks[shaderStorageBlockIndex].Binding =
- shaderStorageBlockBinding;
- }
+ shader_storage_block_binding(ctx, shProg, shaderStorageBlockIndex,
+ shaderStorageBlockBinding);
}
/**