Mesa (glsl2): glsl2: When linking makes a variable not a varying output, make it ir_var_auto.
Eric Anholt
anholt at kemper.freedesktop.org
Tue Jul 13 23:24:36 UTC 2010
Module: Mesa
Branch: glsl2
Commit: c10a68522c400d48553dbd473b9778140842d9dd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c10a68522c400d48553dbd473b9778140842d9dd
Author: Eric Anholt <eric at anholt.net>
Date: Tue Jul 13 11:07:16 2010 -0700
glsl2: When linking makes a variable not a varying output, make it ir_var_auto.
This almost fixes glsl-unused-varying, except that the used varying
gets assigned to the first varying slot (position).
---
src/glsl/linker.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 90dc97b..c71c07d 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1052,7 +1052,10 @@ assign_varying_locations(gl_shader *producer, gl_shader *consumer)
/* An 'out' variable is only really a shader output if its value is read
* by the following stage.
*/
- var->shader_out = (var->location != -1);
+ if (var->location == -1) {
+ var->shader_out = false;
+ var->mode = ir_var_auto;
+ }
}
foreach_list(node, consumer->ir) {
More information about the mesa-commit
mailing list