victory-gpu: compile card compare shaders as cs_5_0 with explicit root signatures #388
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/388"
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?
Imported from readmet3xt-lab/foxhound. Originally posted by kwaadrat on 2026-12-01T21:27:29Z.
Summary
CARD_COMPAREandCARD_COMPARE_BATCHascs_5_0viacrate::host::compileinstead ofcs_5_1with inline[RootSignature(RS)].D3D12SerializeVersionedRootSignature(card_compare_root_signature), keeping the exact same bindings (b0root constants,t0/t1SRVs,u0/u1UAVs).RWStructuredBuffer<uint4> hashes(hashes[piece]) instead ofRWByteAddressBuffer(hashes.Load4), since Wine'sd3dcompiler_47does not support.Load()/.Load4()onRWByteAddressBufferincs_5_0.compile_cstest helper incrates/victory-gpu/src/indirect.rsso existingCARD_COMPARE/CARD_COMPARE_BATCHtests (andVICTORY_BENCH_CScustom shaders that may still use[RootSignature(...)]) continue to work.Why
Neither
CARD_COMPAREnorCARD_COMPARE_BATCHuses Shader Model 5.1 features —cs_5_1was only needed for[RootSignature(RS)]andRWByteAddressBuffer.Load4. Under Wine/Proton (d3dcompiler_47), compilingcs_5_1with[RootSignature(...)]fails withE_FAIL (0x80004005):When
make_card_work()fails,Host::card_ready()staysfalsefor the entire session, disabling all card-resident title buffer copies (shadow::card_for) and forcing all buffer comparisons onto the CPU.Using
crate::host::compilealso ensures anyD3DCompileerror blob is logged rather than discarded.Verification
Built
victory.exeonwindows-latest(cargo build --release --locked -p victory) and tested on RTX 3060 12 GB (i5-9600KF) under Proton Experimental (vkd3d-proton):no host copies in the card's memoryandD3DCompilewarnings are completely gone; title buffer copies are now placed in VRAM (a buffer's host copy is in the card's memory).victory_gpu::shadow) dropped from 559.5 MB (501.3 MBsnapshotted) per frame to 0.6 MB (0.8 MBsnapshotted).preparing per framedropped from 311.1 ms (write watch125.3 ms,snapshots74.7 ms) to 56.4 ms (write watch15.0 ms,snapshots0.1 ms).Imported from readmet3xt-lab/foxhound. Originally posted by readmet3xt-lab on 2026-12-02T01:48:47Z.
Thank you. These pin down exactly which of our own shaders fail under Proton's built-in compiler and what it costs when the card-side compare is missing, which is the clearest data we have on #407. We're going to solve it one level lower: our shaders will ship already compiled, so no shader compiler is asked at run time on any system, and Windows keeps exactly the bytecode it has today. Because of that we won't merge these three as they are (they change the shader model and two buffer types on Windows too). Your findings and measurements go into that change, with credit. When the build is out, a run under Proton with Full logs from you would be the best test we could get.
Imported from readmet3xt-lab/foxhound. Originally posted by kwaadrat on 2026-12-02T06:51:10Z.
Thanks for the clear feedback and for the credit! Shipping those internal shaders precompiled so no runtime
D3DCompileis needed anywhere (while keeping the exact Windows bytecode untouched) is a much cleaner solution.As soon as that build is out, I'll test it under Proton Experimental with
Full logsand report back (here / on #407).Pull request closed