[Mesa-dev] [PATCH 27/28] mesa: add LOCATION_COMPONENT support to GetProgramResourceiv

Anuj Phogat anuj.phogat at gmail.com
Thu Jan 14 12:24:32 PST 2016


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>


More information about the mesa-dev mailing list