[Mesa-dev] [PATCH] mesa: Allow query of GL_VERTEX_BINDING_BUFFER

Ilia Mirkin imirkin at alum.mit.edu
Tue Aug 25 07:26:52 PDT 2015


On Tue, Aug 25, 2015 at 10:18 AM, Fredrik Höglund <fredrik at kde.org> wrote:
> On Monday 24 August 2015, Brian Paul wrote:
>> On 08/19/2015 12:17 PM, Marta Lofstedt wrote:
>> > From: Marta Lofstedt <marta.lofstedt at intel.com>
>> >
>> > According to OpenGL ES 3.1 specification table : 20.2 and
>> > OpenGL specification 4.4 table 23.4. The glGetIntegeri_v
>> > functions should report the name  of the buffer bound
>> > when called with GL_VERTEX_BINDING_BUFFER.
>> >
>> > Signed-off-by: Marta Lofstedt <marta.lofstedt at intel.com>
>> > ---
>> >   src/mesa/main/get.c | 8 ++++++++
>> >   1 file changed, 8 insertions(+)
>> >
>> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
>> > index 307a5ff..ae2d0b7 100644
>> > --- a/src/mesa/main/get.c
>> > +++ b/src/mesa/main/get.c
>> > @@ -1989,6 +1989,14 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
>> >         v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
>> >         return TYPE_INT;
>> >
>> > +   case GL_VERTEX_BINDING_BUFFER:
>> > +      if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles31(ctx))
>> > +          goto invalid_enum;
>>
>> Looks like this enum/query was added in GL 4.3 so don't we need to check
>> for that version?
>
> It was also added in ARB_vertex_attrib_binding, which is always enabled
> on desktop GL.

So I guess this should just be

if (ctx->API == GLES2 && ctx->Version < 31)
  goto invalid_value;

>
>> > +      if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
>> > +          goto invalid_value;
>>
>> Looks like you have 4 spaces of indentation there instead of 3.
>>
>> -Brian
>>
>> > +      v->value_int = ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].BufferObj->Name;
>> > +      return TYPE_INT;
>> > +
>> >      /* ARB_shader_image_load_store */
>> >      case GL_IMAGE_BINDING_NAME: {
>> >         struct gl_texture_object *t;
>> >
>>
>> _______________________________________________
>> 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