Wine: 16-bit depth written through unordered views stays clear, because the converter shader does not compile #1860
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1860
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@CaravelaLabs on GitHub · 2026-11-24 23:38 UTC · original
On main
70564ae, a 16-bit depth value written through the unordered-access twin does not reach the depth texture when the converter cannot be built. Measured here under Wine 11.22 + vkd3d-proton 3.1 + Mesa 25.2.8, Radeon 8060S (RADV GFX1151). Not the AMD Windows driver. The title was not run.A 4×4 depth texture got the unordered view, and the twin was created (16-bit plane, 24-bit depth footprint, so a conversion is required).
0x1234was in every texel of the twin. After the copy toward the depth texture, the depth plane was still 0, not0x123412(u * 256 + (u * 255 + 32767) / 65535). The copy reported that it did not convert. Three runs, same numbers. The device was not removed.Correction: an earlier version of this note said Wine's compiler accepts the converter shader and only warns
W5302about[RootSignature]. That warning was from a shorter shader that only carried the attribute, not from this converter's source. Compiling the converter source with Wine's builtind3dcompiler_47fails first,E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'(buf.Load). The root-signature step is never reached, so the converter is never created, and the copy still runs. The depth side of the scratch buffer was never filled, so the depth texture stays clear.github.com/Marvisak/VIctory@70564ae08c/crates/victory-gpu/src/twin.rs (L484)With Microsoft's
d3dcompiler_47on the same stack, the project's owna_depth_texture_written_through_unordered_views_reads_as_depthpasses (3 of 3). The GPU can convert when the shader compiles and the signature is in the blob. The gap is Wine's compiler, which is what this run, and many Linux players, use by default.A signature built beside the shader does not cover this on Wine 11.22: the compile fails before that fallback runs. #1872 is that fallback. The run is on that pull request.
#170 is a different shader: the indirect clamp, which does not compile at all.
AI-assisted check, run on this machine.
github-bot referenced this issue2026-11-26 05:17:30 +00:00
@BastienRodz on GitHub · 2026-11-24 23:43 UTC · original
Taking this. The fix: when the shader blob has no root signature,
compile()serializes the converter'sRootConstants(8, b0), UAV(u0)withD3D12SerializeRootSignature. The Microsoft compiler path stays as it is. I'll check it againsta_depth_texture_written_through_unordered_views_reads_as_depthunder Wine + vkd3d-proton with the builtin and the natived3dcompiler_47, then open the PR.@BastienRodz on GitHub · 2026-11-24 23:56 UTC · original
PR: #1872. @CaravelaLabs, could you run
a_depth_texture_written_through_unordered_views_reads_as_depthon its branch with your Wine 11.22 + RADV setup? This host's Wine 10 compiler rejects the shader before it gets to the root-signature step, so I could only check the fallback by compiling with the attribute stripped.@CaravelaLabs on GitHub · 2026-11-25 00:08 UTC · original
@BastienRodz ran both tests on
654301a. The result is on #1872.Short version: with Microsoft's compiler both pass, including your fallback. With Wine 11.22's own compiler the converter source fails first,
E5005onbuf.Load, so the fallback is not reached. Same text you saw on Wine 10. I corrected the note above: theW5302line was from a shorter shader, not this source. Sorry for the bad lead.@BastienRodz on GitHub · 2026-11-25 00:28 UTC · original
Status: #1872 is in draft. Wine's compiler rejects every read on
RWByteAddressBuffer(Loadand allInterlocked*) and everyRWStructuredBufferstore, so the root-signature fallback alone can't fix it. Only a typedRWBufferthrough a descriptor table works under the builtin compiler, and it means reworking heap binding indraw.rs. Details and the two options are on #1872.@Marvisak on GitHub · 2026-11-25 12:50 UTC · original
Automated triage for the maintainers.
Confirmed in
main(940d32f):compileincrates/victory-gpu/src/twin.rsbuilds the depth twin's converter at run time withD3DCompile(cs_5_1), from a source that readsRWByteAddressBufferwithbuf.Loadand carries its root signature as a[RootSignature]attribute. Under Wine's builtind3dcompiler_47that source does not compile, so there is no converter and the 16-bit depth written through the unordered view never reaches the depth texture. With Microsoft'sd3dcompiler_47the existing test passes, as reported.Open PR #1872 (draft) adds the root-signature fallback, but per the last comment Wine's compiler also rejects the buffer reads, so it is not enough on its own; the options are discussed on that PR.
Generated by Claude Code