From d51c0b89883c1ac0337e3ba94836e24fc8ab6027 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 24 Nov 2025 13:40:09 +0200 Subject: [PATCH] brw: fix SS surfaces usage In 80c89909f3 ("brw: fixup immediate bindless surface handling") I forgot that we have a special usage for the only _SS surface (the scratch surface). Because it's only delivered in the 31:10 bits of R0 and because we want to minimize the amount of shader instructions for scratch messages, the surface offset in shifted right by the driver to align things properly for the 31:6 extended descriptor format. This is unfortunately incompatible with the full 32bit format of ExBSO. So this surface type currently cannot be considered bindless. We might revisit later if we start using _SS surfaces for other things. Signed-off-by: Lionel Landwerlin Fixes: 80c89909f3 ("brw: fixup immediate bindless surface handling") Reviewed-by: Rohan Garg Part-of: --- src/intel/compiler/brw/brw_lower_logical_sends.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intel/compiler/brw/brw_lower_logical_sends.cpp b/src/intel/compiler/brw/brw_lower_logical_sends.cpp index b7dd3c07642..4ff5b6ed27d 100644 --- a/src/intel/compiler/brw/brw_lower_logical_sends.cpp +++ b/src/intel/compiler/brw/brw_lower_logical_sends.cpp @@ -1121,9 +1121,10 @@ setup_lsc_surface_descriptors(const brw_builder &bld, brw_send_inst *send, const unsigned base_offset_bits = util_bitpack_sint(base_offset, 0, max_imm_bits - 1); + /* On Gfx20+ UGM always uses ExBSO which implies bindless. */ send->bindless_surface = surf_type == LSC_ADDR_SURFTYPE_BSS || - surf_type == LSC_ADDR_SURFTYPE_SS; + (devinfo->ver >= 20 && surf_type == LSC_ADDR_SURFTYPE_SS); switch (surf_type) { case LSC_ADDR_SURFTYPE_BSS: @@ -1639,9 +1640,7 @@ lower_hdc_memory_logical_send(const brw_builder &bld, brw_mem_inst *mem) send->exec_size = components > 8 ? 16 : 8; } - send->bindless_surface = - binding_type == LSC_ADDR_SURFTYPE_BSS || - binding_type == LSC_ADDR_SURFTYPE_SS; + send->bindless_surface = binding_type == LSC_ADDR_SURFTYPE_BSS; /* Set up descriptors */ switch (binding_type) { @@ -1711,8 +1710,9 @@ lower_lsc_varying_pull_constant_logical_send(const brw_builder &bld, inst = NULL; send->sfid = BRW_SFID_UGM; - send->bindless_surface = (surf_type == LSC_ADDR_SURFTYPE_BSS || - surf_type == LSC_ADDR_SURFTYPE_SS); + send->bindless_surface = + surf_type == LSC_ADDR_SURFTYPE_BSS || + (devinfo->ver >= 20 && surf_type == LSC_ADDR_SURFTYPE_SS); assert(!compiler->indirect_ubos_use_sampler);