[Mesa-dev] [PATCH] glsl: mark special built-in inputs referenced by vertex stage
Jose Fonseca
jfonseca at vmware.com
Thu Apr 30 05:03:31 PDT 2015
On 30/04/15 07:27, Tapani Pälli wrote:
> Refactoring done on active attribute queries did not take in to
> account special built-in inputs for the vertex stage. This commit
> sets them referenced by vertex stage so that they get enumerated
> properly.
>
> Fixes Piglit test 'get-active-attrib-returns-all-inputs' failure.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D90243&d=AwIDaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=bu3_ZcZ6axobjqgKE0fhziPd3bfW9btwvYD1Ru2u-AA&s=saiMoDVGeLaMTAKFHIcek6N-QhodhDnmUDKftrl0FoE&e=
> ---
> src/glsl/linker.cpp | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 21fde94..6064f2f 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2556,6 +2556,7 @@ add_interface_variables(struct gl_shader_program *shProg,
> {
> foreach_in_list(ir_instruction, node, sh->ir) {
> ir_variable *var = node->as_variable();
> + uint8_t mask = 0;
>
> if (!var)
> continue;
> @@ -2571,6 +2572,10 @@ add_interface_variables(struct gl_shader_program *shProg,
> var->data.location != SYSTEM_VALUE_VERTEX_ID_ZERO_BASE &&
> var->data.location != SYSTEM_VALUE_INSTANCE_ID)
> continue;
> + /* Mark special built-in inputs referenced by the vertex stage so
> + * that they are considered active by the shader queries.
> + */
> + mask = (1 << (MESA_SHADER_VERTEX));
> /* FALLTHROUGH */
> case ir_var_shader_in:
> if (programInterface != GL_PROGRAM_INPUT)
> @@ -2585,7 +2590,7 @@ add_interface_variables(struct gl_shader_program *shProg,
> };
>
> if (!add_program_resource(shProg, programInterface, var,
> - build_stageref(shProg, var->name)))
> + build_stageref(shProg, var->name) | mask))
> return false;
> }
> return true;
>
I'm not familiar with the specs in question and don't know beforehand
which attributes should be listed as active or not. But if it fixes
piglit sounds good to me, as I assume piglit tests are correct.
Acked-by: Jose Fonseca <jfonseca at vmware.com>
More information about the mesa-dev
mailing list