Repository navigation
Windows: an AMD GPU runs on DX12 too (#155), and DX12 draws meshes right - #190
Merged
Merged
Conversation
#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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withWGPU_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_firstnow 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 explicitWGPU_BACKENDkeep 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.
RAEA_WGPU_INDIRECT_VALIDATION=1, the same frame matches Vulkan's.WGPU_BACKENDleaves DX12 out. Mac, Linux, and a Vulkan-only Windows process keep the speed-up.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
dx12_first's unit test covers Windows app: raea-page-host.exe crashes at launch in atio6axx.dll (0xc0000005) on AMD + NVIDIA dual-GPU laptop; WGPU_BACKEND=dx12 fixes it #155's laptop, with either GPU listed first, plus AMD alone, Intel with NVIDIA, NVIDIA alone, WARP, an explicitWGPU_BACKEND, and non-Windows.indirect_validation_offhas its own test.cargo test -p raea-gpu-devicepasses, and the crate checks forx86_64-pc-windows-msvc.rask check.docs/settings.mdgets aWGPU_BACKENDrow: what raea picks, and the override.🤖 Generated with Claude Code