summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-06-26 15:05:02 +0200
committerSamuel Pitoiset <[email protected]>2017-06-28 10:25:13 +0200
commit277135c1ed5328f8c890c3ea1e25ef4c604a8a09 (patch)
tree27061235a3b533bb891278c73c92fe4d9d433e7a /src/mesa
parentf543107256ab9d901cfea82fed9ab2e0c5fc40ec (diff)
mesa: add uniform_block_binding() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/uniforms.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 71acb288864..ef57866d6dc 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -1085,6 +1085,21 @@ _mesa_GetUniformIndices(GLuint program,
}
}
+static void
+uniform_block_binding(struct gl_context *ctx, struct gl_shader_program *shProg,
+ GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+ if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
+ uniformBlockBinding) {
+
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
+
+ shProg->data->UniformBlocks[uniformBlockIndex].Binding =
+ uniformBlockBinding;
+ }
+}
+
void GLAPIENTRY
_mesa_UniformBlockBinding(GLuint program,
GLuint uniformBlockIndex,
@@ -1117,15 +1132,7 @@ _mesa_UniformBlockBinding(GLuint program,
return;
}
- if (shProg->data->UniformBlocks[uniformBlockIndex].Binding !=
- uniformBlockBinding) {
-
- FLUSH_VERTICES(ctx, 0);
- ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
-
- shProg->data->UniformBlocks[uniformBlockIndex].Binding =
- uniformBlockBinding;
- }
+ uniform_block_binding(ctx, shProg, uniformBlockIndex, uniformBlockBinding);
}
void GLAPIENTRY