summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-11-07 22:56:21 +0100
committerMarek Olšák <[email protected]>2016-11-10 18:34:55 +0100
commit0f6360eedb61ac184473f765eb26058593a679fc (patch)
treea1328482d4ebe89a4838575d1fc0049690a34768 /src/compiler/glsl
parente27333a568aa97a897b0e4129d55dfbaf7dddb9f (diff)
glsl: handle partial swizzles in opt_dead_code_local correctly
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/opt_dead_code_local.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/glsl/opt_dead_code_local.cpp b/src/compiler/glsl/opt_dead_code_local.cpp
index fc979afcd81..a4038794c6b 100644
--- a/src/compiler/glsl/opt_dead_code_local.cpp
+++ b/src/compiler/glsl/opt_dead_code_local.cpp
@@ -106,9 +106,12 @@ public:
int used = 0;
used |= 1 << ir->mask.x;
- used |= 1 << ir->mask.y;
- used |= 1 << ir->mask.z;
- used |= 1 << ir->mask.w;
+ if (ir->mask.num_components > 1)
+ used |= 1 << ir->mask.y;
+ if (ir->mask.num_components > 2)
+ used |= 1 << ir->mask.z;
+ if (ir->mask.num_components > 3)
+ used |= 1 << ir->mask.w;
use_channels(deref->var, used);