summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-03-22 11:55:20 +1100
committerTimothy Arceri <[email protected]>2018-04-10 14:43:45 +1000
commit494a5c350126268c45f3055687e22593a3fd74f4 (patch)
treef337da121d5d19fbed8f922e48e80999bd32a9c4 /src
parentd7cbe795edefb616c2df9d3bda0a2dc80a2c3405 (diff)
radeonsi/nir: tidy up si_nir_load_sampler_desc()
This makes it easier to follow the code, and also initialises dynamic_index which will be useful for adding bindless textures support. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 45cbf1ce7f3..c0e08c79a56 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -885,14 +885,12 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
LLVMBuilderRef builder = ctx->ac.builder;
LLVMValueRef list = LLVMGetParam(ctx->main_fn, ctx->param_samplers_and_images);
- LLVMValueRef index = dynamic_index;
+ LLVMValueRef index;
assert(!descriptor_set);
- if (!index)
- index = ctx->ac.i32_0;
-
- index = LLVMBuildAdd(builder, index,
+ dynamic_index = dynamic_index ? dynamic_index : ctx->ac.i32_0;
+ index = LLVMBuildAdd(builder, dynamic_index,
LLVMConstInt(ctx->ac.i32, base_index + constant_index, false),
"");