[Mesa-dev] [PATCH 1/2] Revert "i965/wm: use proper API buffer size for the surfaces."

Ilia Mirkin imirkin at alum.mit.edu
Mon Jan 4 17:01:01 PST 2016


This reverts commit 8cf2e892fca20c4776b4a07c39918343cb2d4e0e. It's
entirely bogus to attempt to store anything about the binding the buffer
object itself, which might be bound any number of times.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Cc: Marta Lofstedt <marta.lofstedt at intel.com>
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 12 ++++--------
 src/mesa/drivers/dri/i965/intel_buffer_objects.c |  1 -
 src/mesa/main/bufferobj.c                        |  4 +---
 src/mesa/main/mtypes.h                           |  1 -
 4 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 7da4a40..76dc577 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -946,14 +946,12 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
       } else {
          struct intel_buffer_object *intel_bo =
             intel_buffer_object(binding->BufferObject);
-         GLsizeiptrARB size = MIN2(binding->BufferObject->BufferRangeSize,
-                                   binding->BufferObject->Size - binding->Offset);
          drm_intel_bo *bo =
             intel_bufferobj_buffer(brw, intel_bo,
                                    binding->Offset,
-                                   size);
+                                   binding->BufferObject->Size - binding->Offset);
          brw_create_constant_surface(brw, bo, binding->Offset,
-                                     size,
+                                     binding->BufferObject->Size - binding->Offset,
                                      &ubo_surf_offsets[i]);
       }
    }
@@ -970,14 +968,12 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
       } else {
          struct intel_buffer_object *intel_bo =
             intel_buffer_object(binding->BufferObject);
-         GLsizeiptrARB size = MIN2(binding->BufferObject->BufferRangeSize,
-                                   binding->BufferObject->Size - binding->Offset);
          drm_intel_bo *bo =
             intel_bufferobj_buffer(brw, intel_bo,
                                    binding->Offset,
-                                   size);
+                                   binding->BufferObject->Size - binding->Offset);
          brw_create_buffer_surface(brw, bo, binding->Offset,
-                                   size,
+                                   binding->BufferObject->Size - binding->Offset,
                                    &ssbo_surf_offsets[i]);
       }
    }
diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index b26c939..7a5b3fc 100644
--- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -198,7 +198,6 @@ brw_buffer_data(struct gl_context *ctx,
    (void) target;
 
    intel_obj->Base.Size = size;
-   intel_obj->Base.BufferRangeSize = size;
    intel_obj->Base.Usage = usage;
    intel_obj->Base.StorageFlags = storageFlags;
 
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 774d1d5..fef84e0 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -43,7 +43,7 @@
 #include "glformats.h"
 #include "texstore.h"
 #include "transformfeedback.h"
-#include "macros.h"
+
 
 /* Debug flags */
 /*#define VBO_DEBUG*/
@@ -2855,7 +2855,6 @@ bind_buffer_range_uniform_buffer(struct gl_context *ctx,
 
    _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, bufObj);
    bind_uniform_buffer(ctx, index, bufObj, offset, size, GL_FALSE);
-   bufObj->BufferRangeSize = MIN2(size, bufObj->Size);
 }
 
 /**
@@ -2891,7 +2890,6 @@ bind_buffer_range_shader_storage_buffer(struct gl_context *ctx,
 
    _mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer, bufObj);
    bind_shader_storage_buffer(ctx, index, bufObj, offset, size, GL_FALSE);
-   bufObj->BufferRangeSize = MIN2(size, bufObj->Size);
 }
 
 /**
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a03a2c1..dd52368 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1268,7 +1268,6 @@ struct gl_buffer_object
    GLenum Usage;        /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */
    GLbitfield StorageFlags; /**< GL_MAP_PERSISTENT_BIT, etc. */
    GLsizeiptrARB Size;  /**< Size of buffer storage in bytes */
-   GLsizeiptrARB BufferRangeSize;  /**< Amount of data that can be read from or written to, in bytes */
    GLubyte *Data;       /**< Location of storage either in RAM or VRAM. */
    GLboolean DeletePending;   /**< true if buffer object is removed from the hash */
    GLboolean Written;   /**< Ever written to? (for debugging) */
-- 
2.4.10



More information about the mesa-dev mailing list