GPU: compile internal HLSL and serialize root signatures natively under Wine/Proton #127
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/127"
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 fxceless/victory-fork. Originally posted by BitWuehler on 2026-11-24T21:42:04Z.
What & Why
Under Wine/Proton, built-in
d3dcompiler_47(vkd3d-shader) refusesvictory-gpu's internal HLSL in two ways (see #20, #28):ByteAddressBuffer/RWByteAddressBuffermethods (E5005) and[allow_uav_condition](E5017) fail compilation in the indirect-argument clamp (indirect.rs) andCARD_COMPARE(host.rs).[RootSignature(RS)]annotations are stripped (noRTS0chunk), causingID3D12Device::CreateRootSignatureover the shader bytecode to fail withE_FAIL (0x80004005)inCARD_COMPARE,PlanePass(no pipeline to draw a depth plane from its twin), and unit tests (resource::tests::a_depth_planes_twin_is_drawn_into_the_plane,indirect::tests::WORKER_CS).Rather than requiring an external DXC/DXIL SDK fallback at runtime, this change adjusts the four small internal shaders and serializes their root signatures in Rust so Wine's built-in
d3dcompiler_47(vkd3d-shader) compiles everything natively with zero external DLLs:host.rs,indirect.rs):ByteAddressBuffer/RWByteAddressBuffer(Load/Store/atomic methods) with 32-bit word-indexedStructuredBuffer<uint>/RWStructuredBuffer<uint>inCARD_COMPARE,indirect.rs's clamp shaderSOURCE, and testWORKER_CS. Since D3D12 root SRVs/UAVs bind raw buffer GPU VAs with identical descriptors for 4-byte-aligned word buffers, no pipeline binding changes are needed (>> 2/* 4preserves exact byte offsets).[allow_uav_condition]inindirect.rs.make_card_workinhost.rs(matchinghost::compile).host.rs,indirect.rs,resource.rs):crate::host::root_signature_from_params(plusroot_param_constantsandroot_param_descriptor) usingD3D12SerializeRootSignature, and removed#define RS/[RootSignature(RS)]acrossCARD_COMPARE,PlanePass(PLANE_STEPS/PLANE_FLOATS),indirect.rs(SOURCE,WORKER_CS), andresource.rs(a_depth_planes_twin_is_drawn_into_the_plane).indirect.rs):indirect::tests::system_d3dcompile_builds_internal_hlslcompiling all 6 internal HLSL entrypoints (clamp,card_compare,plane_corners,plane_steps,plane_floats,worker_cs) throughcrate::host::compile.Verification
Tested on CachyOS Linux (
GE-Proton11-14,vkd3d-proton, NVIDIA RTX 5080, driver620.73.4,VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains):cargo xtask policy:169 files okcargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings: passed (0 warnings)cargo build --release -p victory --target x86_64-pc-windows-msvc: passedvictory-gputest suite under Proton (GE-Proton11-14): 110 passed, 1 ignored, 1 failedindirect::tests::system_d3dcompile_builds_internal_hlsl,indirect::tests::argument_clamp_builds,indirect::tests::warp_card_compare_stores_the_hash_it_made_when_told,resource::tests::a_depth_planes_twin_is_drawn_into_the_plane, etc.).pipeline::library::tests::a_rejected_blob_gives_an_empty_library(ID3D12Device1::CreatePipelineLibraryunimplemented stub invkd3d-proton, same unrelated failure noted in #20).CARD_COMPARE+indirectfixes active on4e17478+VICTORY_RELAY=2+ upstream#454): reached playable lit world for 464s / 3,815 frames with zero device losses and zerono argument clamp/no host copies in the cardwarnings. Loggingno pipeline to draw a depth plane from its twin (0x80004005)in that run led to includingPlanePassin this PR as well.(Prepared and tested with AI assistance.)
Imported from fxceless/victory-fork. Originally posted by BitWuehler on 2026-11-24T22:39:58Z.
Additional in-world confirmation from
232121.log(GE-Proton11-14, RTX 5080620.73.04, 353 s, 0 crashes/Xids):PlanePassnot only compiles without0x80004005warnings now (0vs2previously), it actively executes on vkd3d-proton (depth planes: 2.0 drawn from their twins per framein the final 5,426-draw interval vs0.0before).Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-24T23:46:38Z.
Review: CHANGES_REQUESTED
Reviewed at
cc79860against2119b0e.The no-DLL approach is interesting, but it is a competing implementation of #20 and is not complete:
inplace.rs, so the in-place probe still usesRWByteAddressBuffer/Load/Storeand still fails under Wine.4e17478with extra switches, not this head.Please close/coordinate with #20, or add the in-place probe and a current-head integration run. As a duplicate, it should not merge alongside #20.
Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-25T00:17:54Z.
Confirmed the card-compare fix on an RTX 5060 Laptop GPU (8 GB), Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton
ec20719. With the same Series S display changes in both builds, an asset-free call toHost::make_card_workfailed withE_FAILbeforecc79860and passed afterward. The PR’s six-shader compiler test also passed using Wine’s built-in compiler.In the running Series S account picker, the control reported zero GPU-side buffer copies and logged the card-compare initialization failure. With this PR applied it reported one 174 MiB GPU-side copy. Gameplay performance was outside this comparison. OpenAI Codex assisted with testing and this report.
Imported from fxceless/victory-fork. Originally posted by BitWuehler on 2026-11-25T21:41:13Z.
Closing this PR as superseded by #20 (
dxc::compilefallback).Thanks @ErRusso for the review and @Filip722 for confirming the
make_card_workand six-shader compiler verification on Proton Experimental.With
main(c36971b) now adding more internal compute shaders (CARD_FETCH,tiles.rs,queue2.rs), maintaining manual structured-word-buffer rewrites and Rust-serialized root signatures alongside #20 would create unnecessary ongoing churn. Centralizeddxc::compilefallback in #20 keeps the upstream HLSL readable as shaders evolve. (One small integration note for #20 when rebasing ontoc36971b:Host::make_card_inflightandqueue2::tests::Warp::newalso invokeD3DCompiledirectly and will benefit from routing throughcrate::dxc::compileas well.)(AI-assisted note.)
Pull request closed