Wine: DXC fallback for host shaders (Series S stretch builds without a patch); 152 world frames at 4.0 fps median 215 ms on 8 GB #1270

Open
opened 2026-11-26 07:40:32 +00:00 by github-bot · 0 comments
Owner

@⁠YaBulochka on GitHub · 2026-11-26 07:37 UTC · original

Wine: host shaders fall back to dxcompiler.dll when D3DCompile refuses them — the Series S stretch then builds without a hand-written HLSL patch, and the Series S profile holds ~4 fps on an 8 GB card

Two Wine-only gaps were costing us shaders, and one fallback closes both. Reporting the technique and the numbers, since they also apply to anyone else running this on Proton/RADV.

Build: main d510ee4 + #1052 + #1011 + #1010 + #1054, plus the remap lock split (neutral here) and the fallback below; x86_64-pc-windows-gnu, --features diagnostics.
Environment: CachyOS kernel 7.3.5, Ryzen 5 9600X, 30 GB, Radeon RX 7600 XT 8 GB, RADV (Mesa 27.0.0), Wine 11.22, vkd3d-proton built from master, dxcompiler.dll/dxil.dll 1.9.2609 next to the executable, retail 1.0.2.1.

The fallback. In host::compile, when D3DCompile fails, the same source is compiled through dxcompiler.dll as <stage>_6_0 (DxcCreateInstance + IDxcCompiler3::Compile, DXC_OUT_OBJECT for the blob, DXC_OUT_ERRORS logged). VICTORY_DXC=1 forces it for testing; otherwise it only runs after a failure, so Microsoft-compiled paths are unchanged on Windows.

What it fixed:

shader before after
overlay corner/over (vs_5_1/ps_5_1) built, unchanged vs_6_0, ps_6_0
Series S stretch (cs_5_1, GetDimensions on a RWTexture2D) E5005, then no pass to stretch the upscaler's input, black 3D cs_6_0, the upscaler's output is made by a plain stretch, picture

With the fallback in place I reverted the hand-written stretch patch (sizes as constants) and the Series S profile still draws, so that patch is no longer needed in our tree.

Throughput, Series S, 152 consecutive world frames (draws > 1,000, so menus do not flatter the average):

before (22:16 run) now
world frames sampled 5 152
average fps 0.26 3.99
median frame 4,991 ms 215 ms
draws per frame 2,858 4,320

Menus stay at 30 fps. VRAM averages 4.6 GB and peaks at 6.1 GB on Series S (Series X peaks at 7.2 GB); GPU busy is 7-16% and 29-81 W, so the remaining cost is still CPU-side preparation, not the card.

One more Wine-only gap, for completeness: without VICTORY_TEXTURE_BUDGET_MB set, room() in resource.rs refuses host copies once the card is 90% full, so on an 8 GB card 5,438 textures (7,045 MB) never get one and everything samples a placeholder. VICTORY_TEXTURE_BUDGET_MB=4096 took that to 369 and the textures appear.

Would you take the fallback as a PR? It is one function plus the COM plumbing; TobiasFornell confirmed the same approach independently on a 9070 XT under Proton (Belobug#183), so there would be two testers.

No game files, dumps or screenshots are included; numbers and technique only.

**@⁠YaBulochka** on GitHub · 2026-11-26 07:37 UTC · [original](https://github.com/fxceless/victory-fork/issues/1270) Wine: host shaders fall back to `dxcompiler.dll` when `D3DCompile` refuses them — the Series S stretch then builds without a hand-written HLSL patch, and the Series S profile holds ~4 fps on an 8 GB card Two Wine-only gaps were costing us shaders, and one fallback closes both. Reporting the technique and the numbers, since they also apply to anyone else running this on Proton/RADV. **Build:** `main` `d510ee4` + #1052 + #1011 + #1010 + #1054, plus the remap lock split (neutral here) and the fallback below; `x86_64-pc-windows-gnu`, `--features diagnostics`. **Environment:** CachyOS kernel 7.3.5, Ryzen 5 9600X, 30 GB, Radeon RX 7600 XT 8 GB, RADV (Mesa 27.0.0), Wine 11.22, vkd3d-proton built from master, `dxcompiler.dll`/`dxil.dll` 1.9.2609 next to the executable, retail 1.0.2.1. **The fallback.** In `host::compile`, when `D3DCompile` fails, the same source is compiled through `dxcompiler.dll` as `<stage>_6_0` (`DxcCreateInstance` + `IDxcCompiler3::Compile`, `DXC_OUT_OBJECT` for the blob, `DXC_OUT_ERRORS` logged). `VICTORY_DXC=1` forces it for testing; otherwise it only runs after a failure, so Microsoft-compiled paths are unchanged on Windows. **What it fixed:** | shader | before | after | |---|---|---| | overlay `corner`/`over` (`vs_5_1`/`ps_5_1`) | built, unchanged | `vs_6_0`, `ps_6_0` | | Series S stretch (`cs_5_1`, `GetDimensions` on a `RWTexture2D`) | `E5005`, then `no pass to stretch the upscaler's input`, black 3D | `cs_6_0`, `the upscaler's output is made by a plain stretch`, picture | With the fallback in place I reverted the hand-written stretch patch (sizes as constants) and the Series S profile still draws, so that patch is no longer needed in our tree. **Throughput, Series S, 152 consecutive world frames** (draws > 1,000, so menus do not flatter the average): | | before (22:16 run) | now | |---|---:|---:| | world frames sampled | 5 | **152** | | average fps | 0.26 | **3.99** | | median frame | 4,991 ms | **215 ms** | | draws per frame | 2,858 | 4,320 | Menus stay at 30 fps. VRAM averages 4.6 GB and peaks at 6.1 GB on Series S (Series X peaks at 7.2 GB); GPU busy is 7-16% and 29-81 W, so the remaining cost is still CPU-side preparation, not the card. **One more Wine-only gap, for completeness:** without `VICTORY_TEXTURE_BUDGET_MB` set, `room()` in `resource.rs` refuses host copies once the card is 90% full, so on an 8 GB card 5,438 textures (7,045 MB) never get one and everything samples a placeholder. `VICTORY_TEXTURE_BUDGET_MB=4096` took that to 369 and the textures appear. Would you take the fallback as a PR? It is one function plus the COM plumbing; TobiasFornell confirmed the same approach independently on a 9070 XT under Proton (Belobug#183), so there would be two testers. No game files, dumps or screenshots are included; numbers and technique only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 07:40:32 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#1270
No description provided.