[Mesa-dev] [PATCH 27/28] mesa: add LOCATION_COMPONENT support to GetProgramResourceiv
Timothy Arceri
timothy.arceri at collabora.com
Thu Jan 14 20:01:11 PST 2016
On Thu, 2016-01-14 at 12:24 -0800, Anuj Phogat wrote:
> On Mon, Dec 28, 2015 at 9:00 PM, Timothy Arceri
> <timothy.arceri at collabora.com> wrote:
> > From Section 7.3.1.1 (Naming Active Resources) of the OpenGL 4.5
> > spec:
> >
> > "For the property LOCATION_COMPONENT, a single integer
> > indicating the first
> > component of the location assigned to an active input or output
> > variable is
> > written to params. For input and output variables with a
> > component specified
> > by a layout qualifier, the specified component is written. For
> > all other
> > input and output variables, the value zero is written."
> > ---
> > src/mesa/main/shader_query.cpp | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/src/mesa/main/shader_query.cpp
> > b/src/mesa/main/shader_query.cpp
> > index e526119..a1813ac 100644
> > --- a/src/mesa/main/shader_query.cpp
> > +++ b/src/mesa/main/shader_query.cpp
> > @@ -1245,6 +1245,15 @@ _mesa_program_resource_prop(struct
> > gl_shader_program *shProg,
> > default:
> > goto invalid_operation;
> > }
> > + case GL_LOCATION_COMPONENT:
> > + switch (res->Type) {
> > + case GL_PROGRAM_INPUT:
> > + case GL_PROGRAM_OUTPUT:
> > + *val = RESOURCE_VAR(res)->data.location_frac;
> > + return 1;
> > + default:
> > + goto invalid_operation;
> > + }
> > case GL_LOCATION_INDEX:
> > if (res->Type != GL_PROGRAM_OUTPUT)
> > goto invalid_operation;
> > --
> > 2.4.3
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
FYI I've just rebased this patch on master [1] I've keeped your r-b as
it was a simple change.
[1] https://github.com/tarceri/Mesa_arrays_of_arrays/commit/b67bd4b2265
74f89844c401a0a8e296fe5b6e8c8
More information about the mesa-dev
mailing list