Mesa (master): glsl: mark special built-in inputs referenced by vertex stage
Tapani Pälli
tpalli at kemper.freedesktop.org
Wed May 6 08:29:38 UTC 2015
Module: Mesa
Branch: master
Commit: 3706e5dbc96aa9cc29c58dad661aa10f20574503
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3706e5dbc96aa9cc29c58dad661aa10f20574503
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Thu Apr 30 09:27:00 2015 +0300
glsl: mark special built-in inputs referenced by vertex stage
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://bugs.freedesktop.org/show_bug.cgi?id=90243
Acked-by: Jose Fonseca <jfonseca at vmware.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
Reviewed-By: Martin Peres <martin.peres at linux.intel.com>
---
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 330fae0..52a277e 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2558,6 +2558,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;
@@ -2573,6 +2574,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)
@@ -2587,7 +2592,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;
More information about the mesa-commit
mailing list