mesa/src
Francisco Jerez a48ecca4d9 intel/brw/gfx12.0+: Sync on all pending send messages after halt target.
This works around a long-standing synchronization issue consequence of
the HALT instruction used to implement FS discard not being considered
a control flow instruction by the back-end -- The fact that it doesn't
cause the CFG pass to introduce an edge in the graph means that the
software scoreboard pass is completely blind to the effect of discard
jumps on control flow, so it doesn't introduce the required
annotations to avoid data hazards when the discard path of the CFG is
taken.  Note that because of the very limited set of instructions that
can follow the HALT target in a fragment shader this was very unlikely
to lead to issues in practice, but starting on xe3 it appears to have
become far more likely due to the use of SENDG, since SENDG requires
the scalar register to be set prior to the submission of the render
target write payloads, which can easily lead to a WaR hazard if there
was another SENDG before the HALT jump that wasn't done reading out
its payload from the GRF.

In an ideal world this would be avoided by having HALT be a normal
control flow instruction represented as an edge in the control flow
graph -- But unfortunately that would prevent the optimizations we
currently do that take advantage of the ability of reordering code
past the HALT instruction, so it would have a pretty large performance
cost.  Instead this simply adds a SYNC.ALLWR instruction after the
HALT target to guarantee that all pending SEND messages have finished
execution -- That may also seem costly, however its cost in practice
appears to be minimal since at the point of the program when the
target HALT is executed there is almost nothing left to do other than
send out the render target write payloads, so any pending operations
had to be waited on at roughly this point of the program regardless.

There appear to be no statistically significant regressions in Traci
on neither BMG nor PTL.  Fixes hangs observed on Dying Light 2 and
Cyberpunk on PTL.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13896
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13965
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14092
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37674>
2025-10-15 01:40:22 +00:00
..
amd ac/nir_flag_smem_for_loads: call divergence analysis internally 2025-10-14 16:33:12 +00:00
android_stub
asahi treewide: use BITSET_CALLOC 2025-10-09 12:29:55 +00:00
broadcom v3d/v3dv/ci: switch to asan rpi5 2025-10-13 12:24:52 +00:00
c11
compiler compiler/rust: Implement dfs() non-recursively 2025-10-14 22:47:40 +00:00
drm-shim drm-shim: fix with asan 2025-09-03 11:47:00 +00:00
egl treewide: use BITSET_CALLOC 2025-10-09 12:29:55 +00:00
etnaviv etnaviv/ci: Add per-gpu GLES2 extension lists 2025-10-07 19:34:29 +00:00
freedreno freedreno/ci: Remove baremetal job templates 2025-10-14 14:47:50 +00:00
gallium zink: enable srgb-mutable for dmabufs when possible 2025-10-14 23:33:00 +00:00
gbm egl,glx: allow OpenGL with old libx11, but disable glthread if it's unsafe 2025-08-21 02:05:26 +00:00
getopt
gfxstream gfxstream: delete magma-over-gfxstream 2025-10-08 15:42:13 +00:00
glx glx: provide glx.pc 2025-10-14 20:53:10 +00:00
gtest
imagination pco/ra: abort if spilling fails 2025-10-14 21:47:30 +00:00
imgui imgui: Silence build warnings for imgui 2025-09-16 06:16:19 +00:00
intel intel/brw/gfx12.0+: Sync on all pending send messages after halt target. 2025-10-15 01:40:22 +00:00
loader meson: use the wayland module 2025-09-22 16:35:26 +00:00
mesa tc: add debug code for tc_set_vertex_elements_for_call_pending 2025-10-14 22:01:10 +00:00
microsoft microsoft/compiler: Respect write masks when lowering unaligned loads and stores 2025-10-10 19:53:15 +00:00
nouveau nil: Add GOBType::TegraColor 2025-10-15 00:30:34 +00:00
panfrost panvk: override can_present_on_device 2025-10-14 14:07:29 +00:00
tool clang-format: Update the .clang-format files to conformance clang-format json-schema 2025-09-09 07:04:55 +00:00
util llvmpipe: Work around WSL 1 missing support for memfd_create() 2025-10-14 17:40:12 +00:00
virtio ci: Rename ANDROID_GPU_MODE to CUTTLEFISH_GPU_MODE 2025-10-08 09:25:24 +00:00
vulkan wsi/display: Fix vkGetRandROutputDisplayEXT when connector is not leased yet. 2025-10-14 18:57:33 +00:00
x11 meson: add missing x11 dependency on libloader_x11 2025-08-08 21:45:59 +00:00
.clang-format clang-format: Move ForEachMacros into src/.clang-format for freedreno 2025-09-09 07:04:55 +00:00
meson.build Revert "meson: use vcs_tag() instead of custom script" 2025-10-06 23:06:11 +00:00