mesa: Add indexed binding points for uniform buffer objects.
[mesa.git] / src / mesa / main / mtypes.h
index cf6d9c16c05f9ddd255535d3b60cae51fd3e7c35..def0db1aa2d5dfa43d56a5a7f68e89113d49ac06 100644 (file)
@@ -3295,6 +3295,20 @@ struct gl_driver_flags
    GLbitfield NewArray;             /**< Vertex array state */
 };
 
+struct gl_uniform_buffer_binding
+{
+   struct gl_buffer_object *BufferObject;
+   /** Start of uniform block data in the buffer */
+   GLintptr Offset;
+   /** Size of data allowed to be referenced from the buffer (in bytes) */
+   GLsizeiptr Size;
+   /**
+    * glBindBufferBase() indicates that the Size should be ignored and only
+    * limited by the current size of the BufferObject.
+    */
+   GLboolean AutomaticSize;
+};
+
 /**
  * Mesa rendering context.
  *
@@ -3437,6 +3451,14 @@ struct gl_context
     */
    struct gl_buffer_object *UniformBuffer;
 
+   /**
+    * Array of uniform buffers for GL_ARB_uniform_buffer_object and GL 3.1.
+    * This is set up using glBindBufferRange() or glBindBufferBase().  They are
+    * associated with uniform blocks by glUniformBlockBinding()'s state in the
+    * shader program.
+    */
+   struct gl_uniform_buffer_binding *UniformBufferBindings;
+
    /*@}*/
 
    struct gl_meta_state *Meta;  /**< for "meta" operations */