Windows: raw twins off 16 bytes only under Wine (fixes device removed, #1) #2

Merged
Gabriel-Ramaldes merged 1 commit from upstream-pr/2 into main 2026-11-27 16:02:02 +00:00
Gabriel-Ramaldes commented 2026-11-27 15:54:40 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by Gabriel-Ramaldes on 2026-11-27T15:54:40Z.


Fixes #1.

What fails on Windows

Every run on Windows lost the device 49 to 102 s in, with no host list for a state prelude; device removed ... (0x887A0001). That is the error in #1, and it happened with every preset I tried.

The "no host list" part only follows from the removal. A run with VICTORY_D3D12_DEBUG=1 names the call that causes it:

ID3D12Device::CreateShaderResourceView: When creating a RAW Shader Resource View, the offset of the
first element from the start of the buffer must be a multiple of 16 bytes.  Thus, FirstElement
(27890541) must be a multiple of 4 since each element is 4 bytes. id=31 severity=1
ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason
(DXGI_ERROR_INVALID_CALL ...)

That view is an exact raw twin (twin_exact, by % 4 == 0, FirstElement = first + by / 4). vkd3d-proton accepts a raw view on any dword, which is why the fork runs under Proton. Windows' own D3D12 runtime treats it as an illegal call and removes the device.

Change

twin_exact() is now on only under Wine (shadow::on_wine()). On Windows the twin goes the way it went before the exact twins: move_raw if it can, otherwise a null view. One info line in the log says so. Nothing changes under Proton.

On Windows, trees may drop out for single frames where the exact twins fixed that under Proton. That trade is better than losing the device. A later change could give Windows exact twins another way, for example by moving more of them through move_raw.

Tested

The scripted runs pressed Enter at 56 s, with the host pad hidden.

  • Machine: RX 9070 XT, Ryzen 7 3700X, 32 GB, Windows 11 build 26300, Adrenalin 32.0.32029.2010.
  • Build: diag, scripts\play.ps1 as shipped.
Build Settings Result
42b2226 -S70 device lost 79 s in (twice)
42b2226 -S70, frame generation off lost 59 s in
42b2226 default lost 49 s in
42b2226 default, VICTORY_D3D12_DEBUG=1 lost 55 s in, message above
42b2226 -Safe lost 102 s in
42b2226 default, all four VICTORY_PORT_*=0 lost 62 s in
42b2226 default, VICTORY_TWIN_EXACT=0 300 s, no loss
this PR default 300 s, no loss, no 0x887A000x in the log
this PR -S70 (FSR + frame generation) 300 s, no loss

cargo test --locked -p victory-gpu --features diagnostics descriptor: 63 passed.

I did not test this under Proton. The code there takes the same path as before (asked && wine).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:issue:5529482448 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/2). Originally posted by [Gabriel-Ramaldes](https://github.com/Gabriel-Ramaldes) on 2026-11-27T15:54:40Z. --- Fixes #1. ## What fails on Windows Every run on Windows lost the device 49 to 102 s in, with `no host list for a state prelude; device removed ... (0x887A0001)`. That is the error in #1, and it happened with every preset I tried. The "no host list" part only follows from the removal. A run with `VICTORY_D3D12_DEBUG=1` names the call that causes it: ``` ID3D12Device::CreateShaderResourceView: When creating a RAW Shader Resource View, the offset of the first element from the start of the buffer must be a multiple of 16 bytes. Thus, FirstElement (27890541) must be a multiple of 4 since each element is 4 bytes. id=31 severity=1 ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_INVALID_CALL ...) ``` That view is an exact raw twin (`twin_exact`, `by % 4 == 0`, `FirstElement = first + by / 4`). vkd3d-proton accepts a raw view on any dword, which is why the fork runs under Proton. Windows' own D3D12 runtime treats it as an illegal call and removes the device. ## Change `twin_exact()` is now on only under Wine (`shadow::on_wine()`). On Windows the twin goes the way it went before the exact twins: `move_raw` if it can, otherwise a null view. One info line in the log says so. Nothing changes under Proton. On Windows, trees may drop out for single frames where the exact twins fixed that under Proton. That trade is better than losing the device. A later change could give Windows exact twins another way, for example by moving more of them through `move_raw`. ## Tested The scripted runs pressed Enter at 56 s, with the host pad hidden. - **Machine:** RX 9070 XT, Ryzen 7 3700X, 32 GB, Windows 11 build 26300, Adrenalin 32.0.32029.2010. - **Build:** diag, `scripts\play.ps1` as shipped. | Build | Settings | Result | |---|---|---| | 42b2226 | `-S70` | device lost 79 s in (twice) | | 42b2226 | `-S70`, frame generation off | lost 59 s in | | 42b2226 | default | lost 49 s in | | 42b2226 | default, `VICTORY_D3D12_DEBUG=1` | lost 55 s in, message above | | 42b2226 | `-Safe` | lost 102 s in | | 42b2226 | default, all four `VICTORY_PORT_*=0` | lost 62 s in | | 42b2226 | default, `VICTORY_TWIN_EXACT=0` | 300 s, no loss | | this PR | default | 300 s, no loss, no `0x887A000x` in the log | | this PR | `-S70` (FSR + frame generation) | 300 s, no loss | `cargo test --locked -p victory-gpu --features diagnostics descriptor`: 63 passed. I did not test this under Proton. The code there takes the same path as before (`asked && wine`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Slaktarn700/SlaktarnVI!2
No description provided.