brw: drop buggy SLM optimization

This was incorrect for OpenCL due to the possibility of variable shared memory
existing despite shared_size == 0. Fortunately the optimization it was trying to
do should be done in NIR via nir_opt_barrier_modes so we can just drop the brw
code and move on with our merry lives. Fixes OpenCL tests on Iris:

non_uniform_work_group non_uniform_3d_barriers
basic async_strided_copy_local_to_global

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bd5ebbb2f8)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40092>
This commit is contained in:
Alyssa Rosenzweig 2026-02-09 18:53:03 -05:00 committed by Eric Engestrom
parent 6278aa107a
commit 806f0a35a4
2 changed files with 1 additions and 7 deletions

View file

@ -4794,7 +4794,7 @@
"description": "brw: drop buggy SLM optimization",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -5158,12 +5158,6 @@ brw_from_nir_emit_intrinsic(nir_to_brw_state &ntb,
if (opcode == BRW_OPCODE_NOP)
break;
if (s.nir->info.shared_size > 0) {
assert(mesa_shader_stage_uses_workgroup(s.stage));
} else {
slm_fence = false;
}
/* If the workgroup fits in a single HW thread, the messages for SLM are
* processed in-order and the shader itself is already synchronized so
* the memory fence is not necessary.