mesa: rename various buffer bindings to one struct.
authorDave Airlie <airlied@redhat.com>
Fri, 15 Sep 2017 02:43:55 +0000 (12:43 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 10 Oct 2017 23:10:20 +0000 (09:10 +1000)
One binding to bind them all, these are all the same thing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/genX_state_upload.c
src/mesa/main/bufferobj.c
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_atom_atomicbuf.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_storagebuf.c

index ae74ff1845ef75bd04dda6233e38960f5b4989c9..c9383b82245ee5db911075c34dea0937bd2f7989 100644 (file)
@@ -1281,7 +1281,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
       &stage_state->surf_offset[prog_data->binding_table.ubo_start];
 
    for (int i = 0; i < prog->info.num_ubos; i++) {
-      struct gl_uniform_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
 
       if (binding->BufferObject == ctx->Shared->NullBufferObj) {
@@ -1306,7 +1306,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
       &stage_state->surf_offset[prog_data->binding_table.ssbo_start];
 
    for (int i = 0; i < prog->info.num_ssbos; i++) {
-      struct gl_shader_storage_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &ctx->ShaderStorageBufferBindings[prog->sh.ShaderStorageBlocks[i]->Binding];
 
       if (binding->BufferObject == ctx->Shared->NullBufferObj) {
@@ -1388,7 +1388,7 @@ brw_upload_abo_surfaces(struct brw_context *brw,
 
    if (prog->info.num_abos) {
       for (unsigned i = 0; i < prog->info.num_abos; i++) {
-         struct gl_atomic_buffer_binding *binding =
+         struct gl_buffer_binding *binding =
             &ctx->AtomicBufferBindings[prog->sh.AtomicBuffers[i]->Binding];
          struct intel_buffer_object *intel_bo =
             intel_buffer_object(binding->BufferObject);
index ecf5a9ae68df88b5ca2b8ef97c4bfe3214700fc7..fd9eb17b9f2008e2aee90ccc08f8c6d43cfcec82 100644 (file)
@@ -3074,7 +3074,7 @@ genX(upload_push_constant_packets)(struct brw_context *brw)
 
                const struct gl_uniform_block *block =
                   prog->sh.UniformBlocks[range->block];
-               const struct gl_uniform_buffer_binding *binding =
+               const struct gl_buffer_binding *binding =
                   &ctx->UniformBufferBindings[block->Binding];
 
                if (binding->BufferObject == ctx->Shared->NullBufferObj) {
index 5a7e90cc293d1511206eade73e0c58961a66e728..b33186680bf2d0f85d79aeb680756c9d531dabfa 100644 (file)
@@ -1265,7 +1265,7 @@ _mesa_BindBuffer(GLenum target, GLuint buffer)
  */
 static void
 set_atomic_buffer_binding(struct gl_context *ctx,
-                          struct gl_atomic_buffer_binding *binding,
+                          struct gl_buffer_binding *binding,
                           struct gl_buffer_object *bufObj,
                           GLintptr offset,
                           GLsizeiptr size,
@@ -1292,7 +1292,7 @@ set_atomic_buffer_binding(struct gl_context *ctx,
  */
 static void
 set_ubo_binding(struct gl_context *ctx,
-                struct gl_uniform_buffer_binding *binding,
+                struct gl_buffer_binding *binding,
                 struct gl_buffer_object *bufObj,
                 GLintptr offset,
                 GLsizeiptr size,
@@ -1319,7 +1319,7 @@ set_ubo_binding(struct gl_context *ctx,
  */
 static void
 set_ssbo_binding(struct gl_context *ctx,
-                 struct gl_shader_storage_buffer_binding *binding,
+                 struct gl_buffer_binding *binding,
                  struct gl_buffer_object *bufObj,
                  GLintptr offset,
                  GLsizeiptr size,
@@ -1353,7 +1353,7 @@ bind_uniform_buffer(struct gl_context *ctx,
                     GLsizeiptr size,
                     GLboolean autoSize)
 {
-   struct gl_uniform_buffer_binding *binding =
+   struct gl_buffer_binding *binding =
       &ctx->UniformBufferBindings[index];
 
    if (binding->BufferObject == bufObj &&
@@ -1384,7 +1384,7 @@ bind_shader_storage_buffer(struct gl_context *ctx,
                            GLsizeiptr size,
                            GLboolean autoSize)
 {
-   struct gl_shader_storage_buffer_binding *binding =
+   struct gl_buffer_binding *binding =
       &ctx->ShaderStorageBufferBindings[index];
 
    if (binding->BufferObject == bufObj &&
@@ -1412,7 +1412,7 @@ bind_atomic_buffer(struct gl_context *ctx, unsigned index,
                    struct gl_buffer_object *bufObj, GLintptr offset,
                    GLsizeiptr size, GLboolean autoSize)
 {
-   struct gl_atomic_buffer_binding *binding =
+   struct gl_buffer_binding *binding =
       &ctx->AtomicBufferBindings[index];
 
    if (binding->BufferObject == bufObj &&
@@ -3807,7 +3807,7 @@ bind_uniform_buffers(struct gl_context *ctx, GLuint first, GLsizei count,
    _mesa_HashLockMutex(ctx->Shared->BufferObjects);
 
    for (int i = 0; i < count; i++) {
-      struct gl_uniform_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &ctx->UniformBufferBindings[first + i];
       struct gl_buffer_object *bufObj;
       GLintptr offset = 0;
@@ -3917,7 +3917,7 @@ bind_shader_storage_buffers(struct gl_context *ctx, GLuint first,
    _mesa_HashLockMutex(ctx->Shared->BufferObjects);
 
    for (int i = 0; i < count; i++) {
-      struct gl_shader_storage_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &ctx->ShaderStorageBufferBindings[first + i];
       struct gl_buffer_object *bufObj;
       GLintptr offset = 0;
@@ -4251,7 +4251,7 @@ bind_atomic_buffers(struct gl_context *ctx,
    _mesa_HashLockMutex(ctx->Shared->BufferObjects);
 
    for (int i = 0; i < count; i++) {
-      struct gl_atomic_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &ctx->AtomicBufferBindings[first + i];
       struct gl_buffer_object *bufObj;
       GLintptr offset = 0;
index f3a16cc2d95a4675a6559d4151d952d2a33c77ae..2802a0e3605bb57da908ab6860ce3d6ae428be2b 100644 (file)
@@ -4550,7 +4550,7 @@ struct gl_driver_flags
    uint64_t NewShaderConstants[MESA_SHADER_STAGES];
 };
 
-struct gl_uniform_buffer_binding
+struct gl_buffer_binding
 {
    struct gl_buffer_object *BufferObject;
    /** Start of uniform block data in the buffer */
@@ -4564,20 +4564,6 @@ struct gl_uniform_buffer_binding
    GLboolean AutomaticSize;
 };
 
-struct gl_shader_storage_buffer_binding
-{
-   struct gl_buffer_object *BufferObject;
-   /** Start of shader storage 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;
-};
-
 /**
  * ARB_shader_image_load_store image unit.
  */
@@ -4632,17 +4618,6 @@ struct gl_image_unit
 
 };
 
-/**
- * Binding point for an atomic counter buffer object.
- */
-struct gl_atomic_buffer_binding
-{
-   struct gl_buffer_object *BufferObject;
-   GLintptr Offset;
-   GLsizeiptr Size;
-   GLboolean AutomaticSize;
-};
-
 /**
  * Shader subroutines storage
  */
@@ -4893,7 +4868,7 @@ struct gl_context
     * associated with uniform blocks by glUniformBlockBinding()'s state in the
     * shader program.
     */
-   struct gl_uniform_buffer_binding
+   struct gl_buffer_binding
       UniformBufferBindings[MAX_COMBINED_UNIFORM_BUFFERS];
 
    /**
@@ -4902,7 +4877,7 @@ struct gl_context
     * glBindBufferBase().  They are associated with shader storage blocks by
     * glShaderStorageBlockBinding()'s state in the shader program.
     */
-   struct gl_shader_storage_buffer_binding
+   struct gl_buffer_binding
       ShaderStorageBufferBindings[MAX_COMBINED_SHADER_STORAGE_BUFFERS];
 
    /**
@@ -4920,7 +4895,7 @@ struct gl_context
    /**
     * Array of atomic counter buffer binding points.
     */
-   struct gl_atomic_buffer_binding
+   struct gl_buffer_binding
       AtomicBufferBindings[MAX_COMBINED_ATOMIC_BUFFERS];
 
    /**
index 171fecccb7c832f0dbe4a408493ddc3296ebe538..7ebcd08dc43f726a63e5a0506cabc106239bfaa3 100644 (file)
@@ -52,7 +52,7 @@ st_bind_atomics(struct st_context *st, struct gl_program *prog,
    for (i = 0; i < prog->sh.data->NumAtomicBuffers; i++) {
       struct gl_active_atomic_buffer *atomic =
          &prog->sh.data->AtomicBuffers[i];
-      struct gl_atomic_buffer_binding *binding =
+      struct gl_buffer_binding *binding =
          &st->ctx->AtomicBufferBindings[atomic->Binding];
       struct st_buffer_object *st_obj =
          st_buffer_object(binding->BufferObject);
index 8c6d61aaa6f91432792c1a028b1c3c3e3c99d6ef..497d33fc348683d8fd0b65c570ba931947080200 100644 (file)
@@ -208,7 +208,7 @@ static void st_bind_ubos(struct st_context *st, struct gl_program *prog,
       return;
 
    for (i = 0; i < prog->info.num_ubos; i++) {
-      struct gl_uniform_buffer_binding *binding;
+      struct gl_buffer_binding *binding;
       struct st_buffer_object *st_obj;
 
       binding =
index 43dd3000a3d7222b0b8f12986687e887193bfa25..a31a8fd4be96f452ad4385e1ac66c3d0e009bc39 100644 (file)
@@ -54,7 +54,7 @@ st_bind_ssbos(struct st_context *st, struct gl_program *prog,
    c = &st->ctx->Const.Program[prog->info.stage];
 
    for (i = 0; i < prog->info.num_ssbos; i++) {
-      struct gl_shader_storage_buffer_binding *binding;
+      struct gl_buffer_binding *binding;
       struct st_buffer_object *st_obj;
       struct pipe_shader_buffer *sb = &buffers[i];