Skip to content

Shaders: lower 64-bit texture atomics to DXIL - #41

Open
gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-image-atomics
Open

gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-image-atomics

Conversation

@gmankab

@gmankab gmankab commented Nov 26, 2026 •

Copy link
Copy Markdown

The Linux native translator refuses a 64-bit image atomic when it sees a two-dword operand. In one RX 6800 world-loading sample, a shader with that refusal accounted for 116 skipped compute dispatches per frame.

The backport lowers the paired operands to DXIL i64 operations, keeps the 32-bit lowering, and returns both dwords of the old value for GLC. It annotates the 64-bit UAV handle and declares both typed-resource and heap-resource atomic features. DXC rejected the earlier lowering when the heap-resource feature was absent.

The synthetic add and compare-exchange cases passed the compiler and DXIL validation test. The particular shader from the earlier profile passed DXIL validation and created a Linux native D3D12 compute pipeline on RX 6800 from both the PR and the integration branches. The fixture stopped at pipeline creation. Atomic lowering source · Heap feature source

The follow-up test executes an exchange and addition on a one-texel R32G32_UINT UAV. RX 6800 and Lavapipe both read back [0, 7], confirming that the addition carried into the high dword. The test queries the 64-bit D3D12 atomic capability flags. The profiled shader still has only the pipeline-creation result above. DirectX specification

Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native
Assisted-by: gpt-6.2 sol xhigh

A compute shader used during world loading was refused because the
compiler recognized only one-dword image atomic operands. Treat pairs
of VGPRs as 64-bit operands, keep the 32-bit path, and return both
dwords of the old value for GLC operations.

Flag both typed-resource and heap-resource atomics. The validator rejects
the shader if the heap flag is missing even when the i64 intrinsic and
typed resource annotation are present. Cover 64-bit add and
compare-exchange with synthetic compiler and DXIL validation tests.

Based-on: Marvisak#305
Based-on: Marvisak#1899
Tested-on: RX 6800, Fedora Linux 45, Linux native
Assisted-by: gpt-6.2 sol xhigh
A successful PSO creation does not prove the runtime can execute the
lowered atomic with a real UAV. Use a one-texel R32G32_UINT image and
read back an exchange followed by an addition that carries out of the
low dword.

Gate the fixture on the typed-resource and descriptor-heap int64
capabilities. vkd3d-proton performs this operation on an R64_UINT
view, so querying atomic support on the base RG32 format alone would
skip devices that support the operation.

Based-on: Marvisak#1899
Based-on: Marvisak#1857
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native
Assisted-by: gpt-6.2 sol xhigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant