[Mesa-dev] [PATCH 2/2] i965/wm: use binding size for ubo/ssbo when automatic size is unset

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Jan 4 22:09:07 PST 2016


On Mon, 2016-01-04 at 20:01 -0500, Ilia Mirkin wrote:
> 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>
> ---
> 
> I have not tested whether this fixes your CTS tests (as I don't have
> access
> to them). But it should... and if it doesn't, it'll be a variation of
> the
> logic used here.
> 

It fixes both CTS tests:

ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-
std430-vec-bindrangeOffset

ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-
std430-vec-bindrangeSize

This series is:

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

Thanks a lot for fixing this,

Sam

>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 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 76dc577..5ab2f7f 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -946,12 +946,15 @@ brw_upload_ubo_surfaces(struct brw_context
> *brw,
>        } else {
>           struct intel_buffer_object *intel_bo =
>              intel_buffer_object(binding->BufferObject);
> +         GLsizeiptr size = binding->BufferObject->Size - binding-
> >Offset;
> +         if (!binding->AutomaticSize)
> +            size = MIN2(size, binding->Size);
>           drm_intel_bo *bo =
>              intel_bufferobj_buffer(brw, intel_bo,
>                                     binding->Offset,
> -                                   binding->BufferObject->Size -
> binding->Offset);
> +                                   size);
>           brw_create_constant_surface(brw, bo, binding->Offset,
> -                                     binding->BufferObject->Size -
> binding->Offset,
> +                                     size,
>                                       &ubo_surf_offsets[i]);
>        }
>     }
> @@ -968,12 +971,15 @@ brw_upload_ubo_surfaces(struct brw_context
> *brw,
>        } else {
>           struct intel_buffer_object *intel_bo =
>              intel_buffer_object(binding->BufferObject);
> +         GLsizeiptr size = binding->BufferObject->Size - binding-
> >Offset;
> +         if (!binding->AutomaticSize)
> +            size = MIN2(size, binding->Size);
>           drm_intel_bo *bo =
>              intel_bufferobj_buffer(brw, intel_bo,
>                                     binding->Offset,
> -                                   binding->BufferObject->Size -
> binding->Offset);
> +                                   size);
>           brw_create_buffer_surface(brw, bo, binding->Offset,
> -                                   binding->BufferObject->Size -
> binding->Offset,
> +                                   size,
>                                     &ssbo_surf_offsets[i]);
>        }
>     }


More information about the mesa-dev mailing list