summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-11-28 15:42:36 +1000
committerDave Airlie <[email protected]>2016-11-28 15:43:59 +1000
commitb2e217369e1ca4bf9d7741721559a4506b1f0ce8 (patch)
tree13054f73be51629ff1754675fafea66bd342b69e /src
parentb56b54cbf1d8e70c87a434da5350d11533e5fed8 (diff)
radv/ac/llvm: fix regression with shadow samplers fix
This fixes b56b54cbf1d8e70c87a434da5350d11533e5fed8: radv/ac/llvm: shadow samplers only return one value It makes sure we only do that for shadow sampling, as opposed to sizing requests. Signed-off-by: Dave Airlie <[email protected]> Cc: "13.0" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 21089024e00..16e30ef110a 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3627,10 +3627,10 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
result = build_tex_intrinsic(ctx, instr, &tinfo);
- if (instr->is_shadow)
- result = LLVMBuildExtractElement(ctx->builder, result, ctx->i32zero, "");
- else if (instr->op == nir_texop_query_levels)
+ if (instr->op == nir_texop_query_levels)
result = LLVMBuildExtractElement(ctx->builder, result, LLVMConstInt(ctx->i32, 3, false), "");
+ if (instr->is_shadow && instr->op != nir_texop_txs && instr->op != nir_texop_lod)
+ result = LLVMBuildExtractElement(ctx->builder, result, ctx->i32zero, "");
else if (instr->op == nir_texop_txs &&
instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&
instr->is_array) {