[Mesa-dev] [PATCH] added functions for binding atomic buffers to extension GL_ARB_shader_atomic_counters for radeonsi and r600 backend

Aditya Avinash adityaavinash1 at gmail.com
Wed Jul 23 15:49:47 PDT 2014


Hi,
I am sorry. This is my first patch. I'll correct it for the next time. Do
you want me to resend it?

On Wednesday, July 23, 2014, Ian Romanick <idr at freedesktop.org> wrote:

> On 07/23/2014 12:39 PM, Marek Olšák wrote:
> > I thought so too, but these bits are really missing there, e.g.
> > glDeleteBuffers doesn't unbind atomic buffers, etc.
>
> D'oh.  It sounds like we need some piglit tests and probably some spec
> quotations. :(
>
> > Marek
> >
> > On Wed, Jul 23, 2014 at 9:25 PM, Ilia Mirkin <imirkin at alum.mit.edu
> <javascript:;>> wrote:
> >> On Wed, Jul 23, 2014 at 3:22 PM, Marek Olšák <maraeo at gmail.com
> <javascript:;>> wrote:
> >>> Please see:
> >>>
> >>> http://lists.freedesktop.org/archives/mesa-dev/2014-July/062818.html
> >>> http://lists.freedesktop.org/archives/mesa-dev/2014-July/063798.html
> >>>
> >>> Also, your git username and address are wrong. You can set them with
> git config.
> >>
> >> In addition to these more basic issues... is this patch needed at all?
> >> I thought the core code was all done and it was just the mesa/st +
> >> gallium interfaces that needed to be fixed up.
> >>
> >>>
> >>> Marek
> >>>
> >>> On Wed, Jul 23, 2014 at 8:27 PM, Aditya Atluri <
> adityaavinash1 at gmail.com <javascript:;>> wrote:
> >>>> From: Frost <frost at ubuntu.(none)>
> >>>>
> >>>> ---
> >>>>  src/mesa/main/bufferobj.c |   30 ++++++++++++++++++++++++++++++
> >>>>  1 file changed, 30 insertions(+)
> >>>>
> >>>> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> >>>> index 7b1bba0..00f2604 100644
> >>>> --- a/src/mesa/main/bufferobj.c
> >>>> +++ b/src/mesa/main/bufferobj.c
> >>>> @@ -832,6 +832,9 @@ _mesa_init_buffer_objects( struct gl_context *ctx
> )
> >>>>     _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer,
> >>>>                                  ctx->Shared->NullBufferObj);
> >>>>
> >>>> +   _mesa_reference_buffer_object(ctx, &ctx->AtomicBuffer,
> >>>> +                 ctx->Shared->NullBufferObj);
> >>>> +
> >>>>     _mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer,
> >>>>                                  ctx->Shared->NullBufferObj);
> >>>>
> >>>> @@ -842,6 +845,14 @@ _mesa_init_buffer_objects( struct gl_context
> *ctx )
> >>>>        ctx->UniformBufferBindings[i].Offset = -1;
> >>>>        ctx->UniformBufferBindings[i].Size = -1;
> >>>>     }
> >>>> +
> >>>> +   for (i = 0; i < MAX_COMBINED_ATOMIC_BUFFERS; i++) {
> >>>> +      _mesa_reference_buffer_object(ctx,
> >>>> +
>  &ctx->AtomicBufferBindings[i].BufferObject,
> >>>> +                                    ctx->Shared->NullBufferObj);
> >>>> +      ctx->AtomicBufferBindings[i].Offset = -1;
> >>>> +      ctx->AtomicBufferBindings[i].Size = -1;
> >>>> +   }
> >>>>  }
> >>>>
> >>>>
> >>>> @@ -857,6 +868,8 @@ _mesa_free_buffer_objects( struct gl_context *ctx
> )
> >>>>
> >>>>     _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, NULL);
> >>>>
> >>>> +   _mesa_reference_buffer_object(ctx, &ctx->AtomicBuffer, NULL);
> >>>> +
> >>>>     _mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer,
> NULL);
> >>>>
> >>>>     for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) {
> >>>> @@ -864,6 +877,12 @@ _mesa_free_buffer_objects( struct gl_context
> *ctx )
> >>>>
> &ctx->UniformBufferBindings[i].BufferObject,
> >>>>                                     NULL);
> >>>>     }
> >>>> +
> >>>> +   for (i = 0; i < MAX_COMBINED_ATOMIC_BUFFERS; i++) {
> >>>> +      _mesa_reference_buffer_object(ctx,
> >>>> +
>  &ctx->AtomicBufferBindings[i].BufferObject,
> >>>> +                                    NULL);
> >>>> +   }
> >>>>  }
> >>>>
> >>>>  bool
> >>>> @@ -1200,6 +1219,17 @@ _mesa_DeleteBuffers(GLsizei n, const GLuint
> *ids)
> >>>>              _mesa_BindBuffer( GL_UNIFORM_BUFFER, 0 );
> >>>>           }
> >>>>
> >>>> +         /* unbind Atomic Buffers binding points */
> >>>> +         for (j = 0; j < ctx->Const.MaxAtomicBufferBindings; j++) {
> >>>> +             if (ctx->AtomicBufferBindings[j].BufferObject ==
> bufObj) {
> >>>> +                 _mesa_BindBufferBase( GL_ATOMIC_COUNTER_BUFFER, j,
> 0 );
> >>>> +             }
> >>>> +         }
> >>>> +
> >>>> +         if (ctx->AtomicBuffer == bufObj) {
> >>>> +            _mesa_BindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
> >>>> +         }
> >>>> +
> >>>>           /* unbind any pixel pack/unpack pointers bound to this
> buffer */
> >>>>           if (ctx->Pack.BufferObj == bufObj) {
> >>>>              _mesa_BindBuffer( GL_PIXEL_PACK_BUFFER_EXT, 0 );
> >>>> --
> >>>> 1.7.9.5
> >>>>
> >>>> _______________________________________________
> >>>> mesa-dev mailing list
> >>>> mesa-dev at lists.freedesktop.org <javascript:;>
> >>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >>> _______________________________________________
> >>> mesa-dev mailing list
> >>> mesa-dev at lists.freedesktop.org <javascript:;>
> >>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org <javascript:;>
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org <javascript:;>
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>


-- 
Regards,

*Aditya Atluri,*

*USA.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140723/d65da9e3/attachment-0001.html>


More information about the mesa-dev mailing list