summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-12-05 10:47:55 -0800
committerPaul Berry <[email protected]>2012-12-14 10:48:52 -0800
commit3e81c666db6940675eca623044e5b372dc6b7756 (patch)
treeba0d5e4cbf1f967d5ac0b600a471f21f52340905 /src/glsl/linker.cpp
parent3c9c17db4a02ab5b1b2f60b9655c20319d9a9093 (diff)
glsl: Create a field to store fractional varying locations.
Currently, the location of each varying is recorded in ir_variable as a multiple of the size of a vec4. In order to pack varyings, we need to be able to record, e.g. that a vec2 is stored in the second half of a varying slot rather than the first half. This patch introduces a field ir_variable::location_frac, which represents the offset within a vec4 where a varying's value is stored. Varyings that are not subject to packing will always have a location_frac value of zero. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index ee6dc2596d0..b13a6aa1ab6 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -226,10 +226,12 @@ link_invalidate_variable_locations(gl_shader *sh, int input_base,
if ((var->location >= base) && !var->explicit_location)
var->location = -1;
- if ((var->location == -1) && !var->explicit_location)
+ if ((var->location == -1) && !var->explicit_location) {
var->is_unmatched_generic_inout = 1;
- else
+ var->location_frac = 0;
+ } else {
var->is_unmatched_generic_inout = 0;
+ }
}
}