Mesa (master): i965: report bound buffer size not underlying buffer size for image size (v2)
Dave Airlie
airlied at kemper.freedesktop.org
Tue Aug 23 03:39:36 UTC 2016
Module: Mesa
Branch: master
Commit: 96ea753d9eb802c95544c79035e89df38daf15f7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=96ea753d9eb802c95544c79035e89df38daf15f7
Author: Dave Airlie <airlied at redhat.com>
Date: Fri May 27 15:00:57 2016 +1000
i965: report bound buffer size not underlying buffer size for image size (v2)
This seems to make sense, the image is bound to a subset of the buffer
so the image size should be from the bound size not the underlying
object.
This fixes:
GL44-CTS.shader_image_size.advanced-nonMS-fs-int
v2: get mininum of the two values, same as we write to the hw.
Reviewed-by: Francisco Jerez <currojerez at riseup.net>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
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 38701d0..2bafe91 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1384,10 +1384,10 @@ update_buffer_image_param(struct brw_context *brw,
struct brw_image_param *param)
{
struct gl_buffer_object *obj = u->TexObj->BufferObject;
-
+ const uint32_t size = MIN2((uint32_t)u->TexObj->BufferSize, obj->Size);
update_default_image_param(brw, u, surface_idx, param);
- param->size[0] = obj->Size / _mesa_get_format_bytes(u->_ActualFormat);
+ param->size[0] = size / _mesa_get_format_bytes(u->_ActualFormat);
param->stride[0] = _mesa_get_format_bytes(u->_ActualFormat);
}
More information about the mesa-commit
mailing list