[Mesa-dev] [PATCH] mesa/bufferobj: fix atomic offset/size get
Tapani Pälli
tapani.palli at intel.com
Thu Oct 12 08:22:06 UTC 2017
On 10/12/2017 11:14 AM, Dave Airlie wrote:
>
> On 12 Oct. 2017 15:40, "Tapani Pälli" <tapani.palli at intel.com
> <mailto:tapani.palli at intel.com>> wrote:
>
>
>
> On 10/12/2017 02:34 AM, Dave Airlie wrote:
>
> From: Dave Airlie <airlied at redhat.com <mailto: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.
>
>
> Alternatively you could set these values as 0 in
> bind_buffer_base_atomic_buffer()? Not sure if it's any better but
> then value would match internally what it has been before these changes.
>
>
> Before these changes the ssbo and atomic code was gratuitously
> different, this is just the last piece of making them consistent.
Right .. what I mean is that before the refactoring Size and Offset
values in the structure were stored as 0, now they are stored as -1 even
though here we return different value. I haven't checked if anything in
Mesa would assume 0 though .. so feel free to ignore my ramblings :) I
just wanted to note this because I tried to fix this and it following
change fixes the bug as well:
@@ -1453,7 +1453,7 @@ bind_buffer_base_atomic_buffer(struct gl_context *ctx,
_mesa_reference_buffer_object(ctx, &ctx->AtomicBuffer, bufObj);
if (bufObj == ctx->Shared->NullBufferObj)
- bind_atomic_buffer(ctx, index, bufObj, -1, -1, GL_TRUE);
+ bind_atomic_buffer(ctx, index, bufObj, 0, 0, GL_TRUE);
> Dave
>
>
>
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103214
> <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
> <mailto: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:
>
>
More information about the mesa-dev
mailing list