summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-03-21 08:52:14 +1000
committerDave Airlie <[email protected]>2016-03-31 09:13:46 +1000
commitca180c09bb0941468814796f13c0701590523be4 (patch)
treebfbd14b5bf4d8bcd35f6f513f2c2f14785cf4c57
parent1ff4cc053589ae2ea10a63116b1e1fe15ecdfbeb (diff)
tgsi_exec: handle execmask when doing indirect lookups
Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 126259fc0f8..a44a05c49f4 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1995,11 +1995,11 @@ fetch_sampler_unit(struct tgsi_exec_machine *mach,
uint sampler)
{
uint unit;
-
+ int i;
if (inst->Src[sampler].Register.Indirect) {
const struct tgsi_full_src_register *reg = &inst->Src[sampler];
union tgsi_exec_channel indir_index, index2;
-
+ const uint execmask = mach->ExecMask;
index2.i[0] =
index2.i[1] =
index2.i[2] =
@@ -2012,7 +2012,13 @@ fetch_sampler_unit(struct tgsi_exec_machine *mach,
&index2,
&ZeroVec,
&indir_index);
- unit = inst->Src[sampler].Register.Index + indir_index.i[0];
+ for (i = 0; i < TGSI_QUAD_SIZE; i++) {
+ if (execmask & (1 << i)) {
+ unit = inst->Src[sampler].Register.Index + indir_index.i[i];
+ break;
+ }
+ }
+
} else {
unit = inst->Src[sampler].Register.Index;
}