[Mesa-dev] [PATCH 7/7] radeonsi/nir: add initial bindless sampler support
Timothy Arceri
tarceri at itsqueeze.com
Tue Feb 20 03:42:33 UTC 2018
---
src/gallium/drivers/radeonsi/si_shader_nir.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index e3e71c6eb6..3294019cea 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -834,13 +834,16 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
return si_load_image_desc(ctx, list, index, desc_type, write);
}
- assert(base_index + constant_index < ctx->num_samplers);
-
- if (dynamic_index)
- index = si_llvm_bound_index(ctx, index, ctx->num_samplers);
-
- index = LLVMBuildAdd(ctx->gallivm.builder, index,
- LLVMConstInt(ctx->i32, SI_NUM_IMAGES / 2, 0), "");
+ if (bindless) {
+ index = get_bindless_index(abi, ctx, index);
+ } else {
+ assert(base_index + constant_index < ctx->num_samplers);
+ if (dynamic_index)
+ index = si_llvm_bound_index(ctx, index, ctx->num_samplers);
+
+ index = LLVMBuildAdd(ctx->gallivm.builder, index,
+ LLVMConstInt(ctx->i32, SI_NUM_IMAGES / 2, 0), "");
+ }
return si_load_sampler_desc(ctx, list, index, desc_type);
}
--
2.14.3
More information about the mesa-dev
mailing list