diff options
author | Nicolai Hähnle <[email protected]> | 2016-11-30 10:38:55 +0100 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-12-12 09:03:47 +0100 |
commit | 173d80b40159669b303ea19e8b6abd24d7fce39b (patch) | |
tree | ca4e28a59a1edb334ad856c60d21038935b3b4ed /src/compiler/glsl/lower_packed_varyings.cpp | |
parent | 6092169b96edb1eb85fd195c426858d4430f9bb3 (diff) |
glsl: remember per-component vertex streams for packed varyings
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_packed_varyings.cpp')
-rw-r--r-- | src/compiler/glsl/lower_packed_varyings.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/lower_packed_varyings.cpp b/src/compiler/glsl/lower_packed_varyings.cpp index b16f25fc93d..7a2f187229b 100644 --- a/src/compiler/glsl/lower_packed_varyings.cpp +++ b/src/compiler/glsl/lower_packed_varyings.cpp @@ -531,6 +531,14 @@ lower_packed_varyings_visitor::lower_rvalue(ir_rvalue *rvalue, ir_dereference *packed_deref = this->get_packed_varying_deref(location, unpacked_var, name, vertex_index); + if (unpacked_var->data.stream != 0) { + assert(unpacked_var->data.stream < 4); + ir_variable *packed_var = packed_deref->variable_referenced(); + for (unsigned i = 0; i < components; ++i) { + packed_var->data.stream |= + unpacked_var->data.stream << (2 * (location_frac + i)); + } + } ir_swizzle *swizzle = new(this->mem_ctx) ir_swizzle(packed_deref, swizzle_values, components); if (this->mode == ir_var_shader_out) { @@ -639,6 +647,7 @@ lower_packed_varyings_visitor::get_packed_varying_deref( packed_var->data.location = location; packed_var->data.precision = unpacked_var->data.precision; packed_var->data.always_active_io = unpacked_var->data.always_active_io; + packed_var->data.stream = 1u << 31; unpacked_var->insert_before(packed_var); this->packed_varyings[slot] = packed_var; } else { |