aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-12-15 15:21:46 -0700
committerBrian Paul <[email protected]>2017-12-20 11:23:17 -0700
commit462df6449523ffbc144641fd8525e55d193ece37 (patch)
treee47d79c8932ae529724f08c408c89a28ae8abd19 /src/compiler
parent06588a065fdfd642917af5710fbedcbc941bb97d (diff)
glsl: simply packing class comparison
Handle comparing the packing class using the same method as we do for var->data.is_xfb_only Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/link_varyings.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 7f42f8a2150..e0f3afb9616 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1775,6 +1775,7 @@ varying_matches::assign_locations(struct gl_shader_program *prog,
unsigned generic_location = 0;
unsigned generic_patch_location = MAX_VARYING*4;
bool previous_var_xfb_only = false;
+ unsigned previous_packing_class = ~0u;
for (unsigned i = 0; i < this->num_matches; i++) {
unsigned *location = &generic_location;
@@ -1809,12 +1810,12 @@ varying_matches::assign_locations(struct gl_shader_program *prog,
if (var->data.must_be_shader_input ||
(this->disable_varying_packing &&
!(previous_var_xfb_only && var->data.is_xfb_only)) ||
- (i > 0 && this->matches[i - 1].packing_class
- != this->matches[i].packing_class )) {
+ (previous_packing_class != this->matches[i].packing_class )) {
*location = ALIGN(*location, 4);
}
previous_var_xfb_only = var->data.is_xfb_only;
+ previous_packing_class = this->matches[i].packing_class;
/* The number of components taken up by this variable. For vertex shader
* inputs, we use the number of slots * 4, as they have different