Repository navigation
D3D12.X: keep untranslated console graphics and stream shaders out of the driver - #303
pedrocalazans05 wants to merge 1 commit into
Conversation
… the driver Mirror dev_create_compute_pso's console-bytecode guard in graphics_pso and dev_create_pipeline_state so untranslated Xbox DXIL (NOBC/XDAT) never reaches the PC shader compiler (AMD's amdxc64.dll fails fast with 0xc0000409 instead of returning E_INVALIDARG). Also fall through to the stand-in PSO when translated_graphics_pso returns a failed HRESULT (e.g. translated_gs_pso on GPUs without mesh shaders), and rewrite console RTV (subobject 15) and DSV (subobject 16) formats to PC formats inside fallback_stream, matching pc_topology_type.
|
Independent test run on commit Tested
Not tested
AI use
|
|
Ran this on the vendor it does not come from: your report is Polaris-only, which is where the guards matter, so a green NVIDIA run says the guard itself costs nothing on a healthy driver. Tested
Counts are lower than Not tested: the AMD fail-fast fix itself (needs one of those cards), any retail title — there is no game package on this machine, so AI use: real run on the machine above, turned into this comment by Hermes Agent with DeepSeek v4.1-flash. Numbers pasted from the |
|
Tested 80fb3be merged onto main 4017f8f (merge 365c47f, no conflicts). The change does what the description says; three things to settle. 1. The new tests cover the two predicates and
2. It conflicts with #214 in
3. From reading, where the graphics guard applies: Tested RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200, debug.
Not tested
🤖 Claude Fable 5.2 |
Mirrors
dev_create_compute_pso's console-bytecode guard ingraphics_psoanddev_create_pipeline_stateso untranslated console DXIL (NOBC/XDAT) never reaches the PC shader compiler. On AMD GPUs (amdxc64.dll), passing stripped console DXIL directly toCreateGraphicsPipelineState/CreatePipelineStatetriggers a fail-fast crash (0xc0000409) instead of returningE_INVALIDARG.When
translated_graphics_psoreturns a failedHRESULT(for exampletranslated_gs_psoon a GPU without D3D12 mesh shaders),graphics_psonow falls through to the stand-in PSO instead of returning the failedHRESULTdirectly. Insidefallback_stream, console RTV (subobject 15) and DSV (subobject 16) formats are translated throughpc_target_format/pc_view_formatjust likepc_topology_typealready does for graphics PSOs.What is in it
crates/xcl/src/hle/d3d12x/real.rs:graphics_has_console_shaderandstream_has_console_shaderguards before rawfinish_psoingraphics_psoanddev_create_pipeline_statetranslated_graphics_psoreturnshr < 015) / DSV (16) format translation infallback_streamconsole_pso_guard_testscovering console-shader detection across all graphics stages / stream subobjects andfallback_streamRTV/DSV format rewritingTested
31.0.21925.1001), Intel Core i3-10100F, Windows 11 Build26300,rustc 1.100.0 (0ef1bc386 2026-11-09), debug (cargo test) & release (cargo build --release --workspace)80fb3be(clean branch on9ab7d76)cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: 81 passed, 0 failed, 1 ignoredcargo test -p xcl --test '*' -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched: 39 passed, 0 failed, 20 ignored, 1 filtered out.\scripts\test.ps1 --skip gpu_wave64_ps_whole_wave_reductions(xcl --lib): 593 passed, 20 failed, 20 ignored, 2 GPU tests skipped (no mesh shaders). All 20 failures (gpu::recomp::tests::gpu_*,CreateComputePipelineState: 0x80070057/ wave32) and the skipped Polaris driver access violation (gpu_wave64_ps_whole_wave_reductions) are pre-existing Polaris/GCN4 hardware limitations unrelated toreal.rs.Regression run
Not tested
test_title_runs_and_game_folder_is_untouched(noSystem32\xgameruntime.dll/ Gaming Services installed on this PC)XCL_SAMPLE_*game-data tests (variables unset)AI use
amdxc64.dll0xc0000409crash from logs, drafted the guard +fallback_streamformat translation +console_pso_guard_testsunit tests, ran the local test/smoke commands above, and performed an adversarial code review (reviewersubagent:APPROVE (LGTM)). Reviewed and verified by the author.