summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-04-26 14:21:09 +0200
committerMarek Olšák <[email protected]>2013-05-11 23:45:01 +0200
commit77d8fbcfd4b79fa022c021ed52bda157d72e1ca9 (patch)
tree0fafc941894d9e67a4dbba6cf16a34876cd8b4f0 /src/mesa/main
parent081c789c3e1c6896bd8446d67db4a6740efdf92d (diff)
mesa: add & use a new driver flag for UBO updates instead of _NEW_BUFFER_OBJECT
v2: move the flagging from intel_bufferobj_data to intel_bufferobj_alloc_buffer Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/bufferobj.c3
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/main/uniforms.c4
3 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index e482c91cd0a..1566cb4c509 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2060,7 +2060,8 @@ set_ubo_binding(struct gl_context *ctx,
return;
}
- FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT);
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
_mesa_reference_buffer_object(ctx, &binding->BufferObject, bufObj);
binding->Offset = offset;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 137f0e3df0a..9e6ea8aed4b 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3333,6 +3333,12 @@ struct gl_driver_flags
/** gl_context::RasterDiscard */
GLbitfield NewRasterizerDiscard;
+
+ /**
+ * gl_context::UniformBufferBindings
+ * gl_shader_program::UniformBlocks
+ */
+ GLbitfield NewUniformBuffer;
};
struct gl_uniform_buffer_binding
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index a53e8e112c9..f0d80f0c812 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -631,7 +631,9 @@ _mesa_UniformBlockBinding(GLuint program,
uniformBlockBinding) {
int i;
- FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT);
+ FLUSH_VERTICES(ctx, 0);
+ ctx->NewDriverState |= ctx->DriverFlags.NewUniformBuffer;
+
shProg->UniformBlocks[uniformBlockIndex].Binding = uniformBlockBinding;
for (i = 0; i < MESA_SHADER_TYPES; i++) {