[Mesa-dev] [PATCH 5/6] mesa/es31: AtomicBufferBindings should be initialized to zero.
Lofstedt, Marta
marta.lofstedt at intel.com
Thu Aug 13 04:00:56 PDT 2015
> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On
> Behalf Of Erik Faye-Lund
> Sent: Tuesday, June 23, 2015 3:41 PM
> To: Marta Lofstedt
> Cc: mesa-dev at lists.freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH 5/6] mesa/es31: AtomicBufferBindings
> should be initialized to zero.
>
> On Tue, Jun 23, 2015 at 2:23 PM, Marta Lofstedt
> <marta.lofstedt at linux.intel.com> wrote:
> > From: Marta Lofstedt <marta.lofstedt at intel.com>
> >
> > Accoring to GLES 3.1 CTS:
> > GLES 3.1 CTS: ES31-CTS.shader_atomic_counters.
> > basic-buffer-bind.
> >
> > AtomicBufferBindings size and start should be initialized to zero.
> >
>
> OpenGL 3.1 says:
>
> "Buffer variables in shader storage blocks are represented in memory in the
> same way as uniforms stored in uniform blocks, as described in section
> 7.6.2.1."
>
> Table 6.2, "Buffer object parameters and their values" defines what seems
> like the initial values for this. And OpenGL 4.5 defines the same.
>
> But I guess someone who knows atomic buffers better than me should
> clarify.
Thanks for the comments Erik, I found tables in both GL 4.5 and GLES 3.1 that states that initial values should be 0.
A V2 is up at: http://patchwork.freedesktop.org/patch/57023/
>
> > Signed-off-by: Marta Lofstedt <marta.lofstedt at intel.com>
> > ---
> > src/mesa/main/bufferobj.c | 11 ++++++++---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> > index 66dee68..94629b3 100644
> > --- a/src/mesa/main/bufferobj.c
> > +++ b/src/mesa/main/bufferobj.c
> > @@ -849,9 +849,14 @@ _mesa_init_buffer_objects( struct gl_context *ctx
> )
> > _mesa_reference_buffer_object(ctx,
> > &ctx->AtomicBufferBindings[i].BufferObject,
> > ctx->Shared->NullBufferObj);
> > - ctx->AtomicBufferBindings[i].Offset = -1;
> > - ctx->AtomicBufferBindings[i].Size = -1;
> > - }
> > + if (_mesa_is_gles31(ctx)) {
> > + ctx->AtomicBufferBindings[i].Offset = 0;
> > + ctx->AtomicBufferBindings[i].Size = 0;
> > + }
> > + else {
> > + ctx->AtomicBufferBindings[i].Offset = -1;
> > + ctx->AtomicBufferBindings[i].Size = -1;
> > + }
> > }
> >
> >
> > --
> > 1.9.1
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list