intel/fs: enable get_buffer_size on bindless heap

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21645>
This commit is contained in:
Lionel Landwerlin
2022-12-27 15:57:53 +02:00
committed by Marge Bot
parent ad9bc1ffb5
commit 01fc9a06bd
3 changed files with 8 additions and 4 deletions

View File

@@ -916,6 +916,8 @@ enum pull_varying_constant_srcs {
enum get_buffer_size_srcs {
/** Surface binding table index */
GET_BUFFER_SIZE_SRC_SURFACE,
/** Surface bindless handle */
GET_BUFFER_SIZE_SRC_SURFACE_HANDLE,
/** LOD */
GET_BUFFER_SIZE_SRC_LOD,

View File

@@ -5037,8 +5037,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
case nir_intrinsic_get_ssbo_size: {
assert(nir_src_num_components(instr->src[0]) == 1);
unsigned ssbo_index = nir_src_is_const(instr->src[0]) ?
nir_src_as_uint(instr->src[0]) : 0;
/* A resinfo's sampler message is used to get the buffer size. The
* SIMD8's writeback message consists of four registers and SIMD16's
@@ -5056,7 +5054,10 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
ubld.MOV(src_payload, brw_imm_d(0));
fs_reg srcs[GET_BUFFER_SIZE_SRCS];
srcs[GET_BUFFER_SIZE_SRC_SURFACE] = brw_imm_ud(ssbo_index);
srcs[get_nir_src_bindless(instr->src[0]) ?
GET_BUFFER_SIZE_SRC_SURFACE_HANDLE :
GET_BUFFER_SIZE_SRC_SURFACE] =
get_nir_buffer_intrinsic_index(bld, instr);
srcs[GET_BUFFER_SIZE_SRC_LOD] = src_payload;
fs_inst *inst = ubld.emit(SHADER_OPCODE_GET_BUFFER_SIZE, ret_payload,
srcs, GET_BUFFER_SIZE_SRCS);

View File

@@ -2742,6 +2742,7 @@ lower_get_buffer_size(const fs_builder &bld, fs_inst *inst)
assert(inst->exec_size == 8);
fs_reg surface = inst->src[GET_BUFFER_SIZE_SRC_SURFACE];
fs_reg surface_handle = inst->src[GET_BUFFER_SIZE_SRC_SURFACE_HANDLE];
fs_reg lod = inst->src[GET_BUFFER_SIZE_SRC_LOD];
inst->opcode = SHADER_OPCODE_SEND;
@@ -2763,7 +2764,7 @@ lower_get_buffer_size(const fs_builder &bld, fs_inst *inst)
inst->dst = retype(inst->dst, BRW_REGISTER_TYPE_UW);
inst->sfid = BRW_SFID_SAMPLER;
setup_surface_descriptors(bld, inst, desc, surface, fs_reg() /* surface_handle */);
setup_surface_descriptors(bld, inst, desc, surface, surface_handle);
}
bool