mesa: Mark buffer objects which are bound as UBOs
authorChris Forbes <chrisf@ijw.co.nz>
Wed, 1 Oct 2014 06:27:11 +0000 (19:27 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 16 Oct 2014 09:31:43 +0000 (22:31 +1300)
When a buffer object is bound to one of the indexed uniform buffer
binding points, assume that from that point on it may be used as
a uniform buffer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/bufferobj.c

index b6879ceb581cf49dbf6d093f2a45e67b4c0b70c1..c92056aa352d4758b432e2a1cb13a0f34f0cd86c 100644 (file)
@@ -2652,6 +2652,12 @@ set_ubo_binding(struct gl_context *ctx,
    binding->Offset = offset;
    binding->Size = size;
    binding->AutomaticSize = autoSize;
+
+   /* If this is a real buffer object, mark it has having been used
+    * at some point as a UBO.
+    */
+   if (size >= 0)
+      bufObj->UsageHistory |= USAGE_UNIFORM_BUFFER;
 }
 
 /**