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 <lionel.g.landwerlin@intel.com>
Fixes: 80c89909f3 ("brw: fixup immediate bindless surface handling")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38618>
This commit is contained in:
Lionel Landwerlin 2025-11-24 13:40:09 +02:00 committed by Marge Bot
parent e2307942a8
commit d51c0b8988

View file

@ -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);