Skip to content

Windows: an AMD GPU runs on DX12 too (#155), and DX12 draws meshes right - #190

Merged
shinyobjectz merged 1 commit into
mainfrom
windows-gpu-dx12
Nov 19, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
windows-gpu-dx12

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

Fixes #155: raea's Windows app crashed before its window in AMD's OpenGL driver (atio6axx.dll, 0xc0000005) on a laptop with an AMD 780M beside an RTX 5060, and ran with WGPU_BACKEND=dx12.

The backend rule. #180 put Intel GPUs on DX12, but it looked only at DX12's high-performance pick, which on #155's laptop is the NVIDIA GPU. dx12_first now looks at every GPU DX12 lists: an Intel or AMD GPU (not WARP) puts the process on DX12, whichever GPU it then draws on. A PC with only NVIDIA GPUs, a Mac, Linux, and an explicit WGPU_BACKEND keep wgpu's own pick.

A bug this found in #180. On the RTX 4070 (the GPU DX12 picks on that laptop), DX12 drew meshes wrong: a box and a sphere came out as one mangled shape, while Vulkan matched the Mac.

  • The cause: the shared device drops wgpu's indirect-draw validation in release builds, and on DX12 that pass is what writes each indirect draw's first vertex and first instance (wgpu-core's "D3D12 special constants").
  • With RAEA_WGPU_INDIRECT_VALIDATION=1, the same frame matches Vulkan's.
  • The validation now stays wherever DX12 can be the backend: on Windows, unless WGPU_BACKEND leaves DX12 out. Mac, Linux, and a Vulkan-only Windows process keep the speed-up.
  • Without this, Windows: an Intel GPU runs on DX12, not Vulkan (0.1.7's Intel integrated graphics crash) #180 would have shipped mangled 3D on every Intel GPU on Windows.

Known cost, not changed here. DX12 compiles shaders with FXC, because raea ships no dxcompiler.dll, and DXC 1.9.2609 fails on bevy_hanabi's shaders ("error reading 'hanabi:shader:utils'"). A 3D frame took 22 s on DX12 against 8 s on Vulkan on the 4070. Making DXC work is a follow-up.

Tests

docs/settings.md gets a WGPU_BACKEND row: what raea picks, and the override.

🤖 Generated with Claude Code

#155: raea's app crashed before its window in AMD's OpenGL driver (atio6axx.dll, 0xc0000005) on a laptop with an
AMD 780M beside an RTX 5060, under wgpu's every-backend default and under Vulkan, and ran with WGPU_BACKEND=dx12.
#180 put an Intel GPU on DX12, but looked only at DX12's high-performance pick, which on that laptop is the NVIDIA
GPU. Now dx12_first looks at every GPU DX12 lists: an Intel or AMD one (not WARP) puts the process on DX12, whichever
GPU it then draws on. A PC with only NVIDIA GPUs, a Mac, Linux and a WGPU_BACKEND someone set keep wgpu's own pick.

Testing that on the RTX 4070 (the laptop's pick) found DX12 drawing meshes wrong: a box and a sphere came out as one
mangled shape. The shared device drops wgpu's indirect-draw validation in release builds, and on DX12 that pass is
what writes each indirect draw's first vertex and first instance (wgpu-core's D3D12 special constants). With it on,
the same frame matches Vulkan's. So the validation now stays wherever DX12 can be the backend (on Windows, unless
WGPU_BACKEND leaves DX12 out); Mac, Linux and a Vulkan-only Windows process keep the speed-up. Without this, 0.1.8's
#180 would have drawn every Intel GPU's 3D mangled.

Known cost, unchanged here: DX12 compiles shaders with FXC (raea ships no dxcompiler.dll; DXC 1.9.2609 fails on
bevy_hanabi's shaders), so a 3D render's first frame on DX12 took 22 s on the 4070 against Vulkan's 8 s.

docs/settings.md gets a WGPU_BACKEND row (what raea picks, and the override).
@shinyobjectz
shinyobjectz merged commit 8a94b68 into main Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows app: raea-page-host.exe crashes at launch in atio6axx.dll (0xc0000005) on AMD + NVIDIA dual-GPU laptop; WGPU_BACKEND=dx12 fixes it

1 participant