summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-10-25 07:47:13 +1000
committerDave Airlie <[email protected]>2016-11-27 23:05:01 +0000
commitb56b54cbf1d8e70c87a434da5350d11533e5fed8 (patch)
treefa9ff85382fea7aff2623094a02b1f893114cd57 /src/amd
parent9838db8f643354e485f74664b92b902fe0b95c4f (diff)
radv/ac/llvm: shadow samplers only return one value.
The intrinsic engine asserts in llvm due to this. Reported-by: Christoph Haag <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 76d6d887885..21089024e00 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3627,7 +3627,9 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
result = build_tex_intrinsic(ctx, instr, &tinfo);
- if (instr->op == nir_texop_query_levels)
+ if (instr->is_shadow)
+ result = LLVMBuildExtractElement(ctx->builder, result, ctx->i32zero, "");
+ else if (instr->op == nir_texop_query_levels)
result = LLVMBuildExtractElement(ctx->builder, result, LLVMConstInt(ctx->i32, 3, false), "");
else if (instr->op == nir_texop_txs &&
instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&