summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-10-16 17:34:33 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-24 09:03:16 +0100
commit8f807e914f8c7f30f8d57e1829d4cb0bd8836a21 (patch)
treed8fd8026092964e2d6517034e38bd9bd60ad3f0a /src/mesa/state_tracker
parent3581e21d5b0c90a3f3858f0b92f7fe58ead95560 (diff)
downloadexternal_mesa3d-8f807e914f8c7f30f8d57e1829d4cb0bd8836a21.zip
external_mesa3d-8f807e914f8c7f30f8d57e1829d4cb0bd8836a21.tar.gz
external_mesa3d-8f807e914f8c7f30f8d57e1829d4cb0bd8836a21.tar.bz2
st/glsl_to_tgsi: fix block copies of arrays of structs
Use a full writemask in this case. This is relevant e.g. when a function has an inout argument which is an array of structs. v2: use C-style comment (Timothy Arceri) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit a1895685f8f341e7facf3c5705bdee99860e3082)
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 562587e..854decc 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2941,10 +2941,12 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir)
} else if (ir->write_mask == 0) {
assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector());
- if (ir->lhs->type->is_array() || ir->lhs->type->is_matrix()) {
- unsigned num_elements = ir->lhs->type->without_array()->vector_elements;
+ unsigned num_elements = ir->lhs->type->without_array()->vector_elements;
+
+ if (num_elements) {
l.writemask = u_bit_consecutive(0, num_elements);
} else {
+ /* The type is a struct or an array of (array of) structs. */
l.writemask = WRITEMASK_XYZW;
}
} else {