mesa/src
Francisco Jerez 3e0544ea2d intel/brw/gfx12.5+: Fix IR of sub-dword atomic LSC operations.
We were currently emitting logical atomic instructions with a packed
destination region for sub-dword LSC atomics, along the lines of:

> untyped_atomic_logical(32) dst<1>:HF, ...

However, these instructions use an LSC data size D16U32, which means
that the 16b data on the return payload is expanded to 32b by the LSC
shared function, so we were lying to the compiler about the location
of the individual channels on the return payload, its execution
masking, etc.  This is why the hacks that manually set the
'inst->size_written' of the instruction were required.

In some cases this worked, but any non-trivial manipulation of the
instruction destination by lowering or optimization passes could have
led to corruption, as has been reproduced in deqp-vk during
lower_simd_width() for shaders that use 16-bit atomics in SIMD32
dispatch mode.

Note that LSC sub-dword reads aren't affected by this because they use
raw UD destinations and specify the actual bit size of the operation
datatype as the immediate SURFACE_LOGICAL_SRC_IMM_ARG, which doesn't
work for atomic operations since that immediate specifies the atomic
opcode.

Instead, have the logical operation implement the behavior of 16-bit
destinations correctly instead of silently replacing the 16-bit region
with an inconsistent 32-bit region -- This is done by emitting the MOV
instructions used to pack the data from the UD temporary into the
packed destination from the lower_logical_sends() pass instead of from
the NIR translation pass.

Fixes: 43169dbbe5 ("intel/compiler: Support 16 bit float ops")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30683>
(cherry picked from commit 71ca8529c5)
2024-08-21 19:06:46 +02:00
..
amd aco: fix bogus assert in RT prolog on GFX11+ 2024-08-20 18:42:17 +02:00
android_stub vulkan/android: Add helper to probe AHB support 2024-05-14 14:53:44 +00:00
asahi format: Generate endian-independent format aliases 2024-07-19 13:50:42 +00:00
broadcom spirv: handle function parameters passed by value 2024-07-23 21:58:58 +02:00
c11 build: pass licensing information in SPDX form 2024-06-29 12:42:49 -07:00
compiler nir/opt_loop: Don't peel initial break if loop ends in break 2024-08-20 17:45:01 +02:00
drm-shim drm-shim: stub synobj_timeline_wait and query ioctl 2024-07-16 11:17:59 +02:00
egl egl/wayland: bail on zink init in non-sw mode if extension check fails 2024-08-14 11:52:44 +02:00
etnaviv format: Generate endian-independent format aliases 2024-07-19 13:50:42 +00:00
freedreno Revert "tu/a750: Disable HW binning when there is GS" 2024-08-16 17:32:37 +02:00
gallium iris: Invalidate state cache for some depth fast clears 2024-08-21 19:06:45 +02:00
gbm gbm: depend on libdrm indepedent of dri2 setting 2024-08-21 11:07:01 +02:00
getopt build: pass licensing information in SPDX form 2024-06-29 12:42:49 -07:00
glx glx/dri2: strdup driver name 2024-08-20 18:34:45 +02:00
gtest build: pass licensing information in SPDX form 2024-06-29 12:42:49 -07:00
imagination pvr: Handle VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO 2024-07-23 22:02:50 +02:00
imgui
intel intel/brw/gfx12.5+: Fix IR of sub-dword atomic LSC operations. 2024-08-21 19:06:46 +02:00
loader loader: gc loader_get_extensions_name() and __DRI_DRIVER_{GET_,}EXTENSIONS defines 2024-07-21 14:59:05 +02:00
mapi mesa_interface: Move out of GL/internal/ 2024-07-17 23:47:05 +00:00
mesa st/pbo: reject vs/fs pbo ops if rowstride < width 2024-08-21 19:06:44 +02:00
microsoft microsoft/clc: Split struct copies before vars_to_ssa in pre-inline optimizations 2024-07-23 21:58:56 +02:00
nouveau nouveau/mme: Fix add64 of immediates on Fermi 2024-08-20 17:45:04 +02:00
panfrost panvk: Adjust RGB component order for fixed-function blending 2024-08-16 17:53:35 +02:00
tool build: pass licensing information in SPDX form 2024-06-29 12:42:49 -07:00
util util: detect LoongArch architecture 2024-08-14 16:06:05 +02:00
virtio venus: fix a race condition between gem close and gem handle tracking 2024-07-28 21:52:50 +02:00
vulkan vulkan/runtime: fix GetBufferMemoryRequirements2 for maintenance4 2024-08-20 17:52:20 +02:00
.clang-format asahi: add agx_ppp_push_merged helper 2024-05-14 04:57:27 +00:00
meson.build gbm: link directly with libgallium 2024-07-18 20:30:43 +00:00