[Mesa-dev] [PATCH] mesa/bufferobj: fix atomic offset/size get

Mark Janes mark.a.janes at intel.com
Thu Oct 12 13:18:36 UTC 2017


Tested-by: Mark Janes <mark.a.janes at intel.com>

Dave Airlie <airlied at gmail.com> writes:

> From: Dave Airlie <airlied at redhat.com>
>
> When I realigned the bufferobj code, I didn't see the getters
> were different, realign the getters to work the same as ssbo.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103214
> Fixes: 65d3ef7cd (mesa: align atomic buffer handling code with ubo/ssbo (v1.1))
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/main/get.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 4c4a4a7..e68a93b 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -2349,7 +2349,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
>           goto invalid_enum;
>        if (index >= ctx->Const.MaxAtomicBufferBindings)
>           goto invalid_value;
> -      v->value_int64 = ctx->AtomicBufferBindings[index].Offset;
> +      v->value_int64 = ctx->AtomicBufferBindings[index].Offset < 0 ? 0 :
> +                       ctx->AtomicBufferBindings[index].Offset;
>        return TYPE_INT64;
>  
>     case GL_ATOMIC_COUNTER_BUFFER_SIZE:
> @@ -2357,7 +2358,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
>           goto invalid_enum;
>        if (index >= ctx->Const.MaxAtomicBufferBindings)
>           goto invalid_value;
> -      v->value_int64 = ctx->AtomicBufferBindings[index].Size;
> +      v->value_int64 = ctx->AtomicBufferBindings[index].Size < 0 ? 0 :
> +                       ctx->AtomicBufferBindings[index].Size;
>        return TYPE_INT64;
>  
>     case GL_VERTEX_BINDING_DIVISOR:
> -- 
> 2.9.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list