[Mesa-dev] [PATCH 5/5] mesa/st: fix atomic buffer sizing to align with ssbo.
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Sep 15 08:07:18 UTC 2017
Except two minor comments, series is:
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Nice refactoring. :)
On 09/15/2017 05:57 AM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This respects the size from the range setting like ssbo.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/mesa/state_tracker/st_atom_atomicbuf.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c b/src/mesa/state_tracker/st_atom_atomicbuf.c
> index 7ebcd08..ee5944f 100644
> --- a/src/mesa/state_tracker/st_atom_atomicbuf.c
> +++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
> @@ -62,6 +62,12 @@ st_bind_atomics(struct st_context *st, struct gl_program *prog,
> sb.buffer = st_obj->buffer;
> sb.buffer_offset = binding->Offset;
> sb.buffer_size = st_obj->buffer->width0 - binding->Offset;
> +
> + /* AutomaticSize is FALSE if the buffer was set with BindBufferRange.
> + * Take the minimum just to be sure.
> + */
> + if (!binding->AutomaticSize)
> + sb.buffer_size = MIN2(sb.buffer_size, (unsigned) binding->Size);
> }
>
> st->pipe->set_shader_buffers(st->pipe, shader_type,
>
More information about the mesa-dev
mailing list