diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 2750ac6bca8..77f23cd1ae3 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -121,6 +121,14 @@ struct brw_compiler { */ bool extended_bindless_surface_offset; + /** + * Gfx11+ has a bit in the dword 3 of the sampler message header that + * indicates whether the sampler handle is relative to the dynamic state + * base address (0) or the bindless sampler base address (1). The driver + * can select this. + */ + bool use_bindless_sampler_offset; + struct nir_shader *clc_shader; }; diff --git a/src/intel/compiler/brw_lower_logical_sends.cpp b/src/intel/compiler/brw_lower_logical_sends.cpp index 03095724403..6e68008d293 100644 --- a/src/intel/compiler/brw_lower_logical_sends.cpp +++ b/src/intel/compiler/brw_lower_logical_sends.cpp @@ -882,7 +882,12 @@ lower_sampler_logical_send_gfx7(const fs_builder &bld, fs_inst *inst, opcode op, * address space but means we can do something more efficient in the * shader. */ - ubld1.MOV(component(header, 3), sampler_handle); + if (compiler->use_bindless_sampler_offset) { + assert(devinfo->ver >= 11); + ubld1.OR(component(header, 3), sampler_handle, brw_imm_ud(1)); + } else { + ubld1.MOV(component(header, 3), sampler_handle); + } } else if (is_high_sampler(devinfo, sampler)) { fs_reg sampler_state_ptr = retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD);