Quoting Kenneth Graunke (2017-06-13 01:33:32)
> We can promote INVALIDATE_RANGE_BIT to INVALIDATE_BUFFER_BIT if the
> range contains the only valid data in the buffer.  This allows us to
> orphan the storage, instead of doing stall avoidance blits.
> ---
>  src/mesa/drivers/dri/i965/intel_buffer_objects.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> I don't have any performance data for this.
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c 
> b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
> index 09c18db1afe..c305539e1b5 100644
> --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
> +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
> @@ -371,6 +371,13 @@ brw_map_buffer_range(struct gl_context *ctx,
>        return NULL;
>     }
>  
> +   if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&
> +       (length == obj->Size ||
> +        (intel_obj->valid_data_start >= offset &&
> +         intel_obj->valid_data_end <= offset + length))) {
> +      access |= GL_MAP_INVALIDATE_BUFFER_BIT;

Lgtm, but repetition here could be moved to a helper.
-Chris
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to