summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 6a1a0b5f113..89edaa41d27 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -2410,10 +2410,21 @@ nir_visitor::visit(ir_texture *ir)
}
nir_deref_instr *sampler_deref = evaluate_deref(ir->sampler);
- instr->src[0].src = nir_src_for_ssa(&sampler_deref->dest.ssa);
- instr->src[0].src_type = nir_tex_src_texture_deref;
- instr->src[1].src = nir_src_for_ssa(&sampler_deref->dest.ssa);
- instr->src[1].src_type = nir_tex_src_sampler_deref;
+
+ /* check for bindless handles */
+ if (sampler_deref->mode != nir_var_uniform ||
+ nir_deref_instr_get_variable(sampler_deref)->data.bindless) {
+ nir_ssa_def *load = nir_load_deref(&b, sampler_deref);
+ instr->src[0].src = nir_src_for_ssa(load);
+ instr->src[0].src_type = nir_tex_src_texture_handle;
+ instr->src[1].src = nir_src_for_ssa(load);
+ instr->src[1].src_type = nir_tex_src_sampler_handle;
+ } else {
+ instr->src[0].src = nir_src_for_ssa(&sampler_deref->dest.ssa);
+ instr->src[0].src_type = nir_tex_src_texture_deref;
+ instr->src[1].src = nir_src_for_ssa(&sampler_deref->dest.ssa);
+ instr->src[1].src_type = nir_tex_src_sampler_deref;
+ }
unsigned src_number = 2;