From: Samuel Iglesias Gonsalvez <[email protected]>

The returned drm buffer object has a size multiple of 4096 but that should not
be exposed to the API user, which is working with a different size.

As far as I can see this problem is only visible in the calculation of the
length of unsized arrays used in SSBOs, as the implementation of this needs
to query the underlying buffer size via a message.

Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 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 5b73c28..395bbe4 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -941,7 +941,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
                                       binding->Offset,
                                       binding->BufferObject->Size - 
binding->Offset);
             brw_create_constant_surface(brw, bo, binding->Offset,
-                                        bo->size - binding->Offset,
+                                        binding->BufferObject->Size - 
binding->Offset,
                                         &surf_offsets[i],
                                         dword_pitch);
          }
@@ -958,7 +958,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
                                       binding->Offset,
                                       binding->BufferObject->Size - 
binding->Offset);
             brw_create_buffer_surface(brw, bo, binding->Offset,
-                                      bo->size - binding->Offset,
+                                      binding->BufferObject->Size - 
binding->Offset,
                                       &surf_offsets[i],
                                       dword_pitch);
          }
-- 
1.9.1

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to