Repository navigation
Recompiler: direct DXIL geometry shaders read ES inputs from window 0's heap view - #2254
joeypercia wants to merge 1 commit into
Conversation
…'s heap view
With the memory windows in the descriptor heap (XCL_HEAP_WINDOWS=1), `mems`
holds placeholders whose handle is the constant 0, and only counts the
windows. The GS entry (`geom_init`) loaded the ES outputs it reads (v9..)
through `mems[0]` directly, so the raw load took an i32 as its handle. The
DXIL builder refuses that ("function dx.op.rawBufferLoad.i32 redeclared with
another type"), and the direct route gives up on the shader.
On the newer retail title's shader pack that is 158 of its 390 geometry
shaders (`xcl shaders <pack> --direct --sample 0 --windows 260`): 232
translated before, 390 now, all of them validating. Window 0 now comes from
the heap (`MEM_HEAP_BASE`), as every other access takes it in this mode.
|
Tested Independent Windows verification on clean
On both PCs the failures were
Not tested Heap-window geometry GPU readback with inputs, the exact parent, full AMD workspace, Intel, and retail smoke or performance. AI use Ran via Samaritan:
|
With the memory windows in the descriptor heap (
XCL_HEAP_WINDOWS=1, the setting #2057 runs with), the direct DXIL translator refuses 158 of the newer retail title's 390 geometry shaders, and they fall back to the HLSL route (direct_fallback). The GS entry (geom_init) loads the ES outputs it reads (v9..) throughlw.mems[0]. In heap mode that's a placeholder whose handle is the constant0(kernel::mem_windows: "memsthen only counts them"), so the raw load gets ani32as its handle. The DXIL builder refuses that:function dx.op.rawBufferLoad.i32 redeclared with another type. Window 0 now comes from the heap (MEM_HEAP_BASE), as every other access in this mode takes it.Part of #1269 (fewer programs off the direct route).
What is in it
crates/xcl/src/gpu/dxil/kernel.rs:geom_inittakes window 0's raw view from the descriptor heap whenheap_memis set, andmems[0]otherwise (unchanged).crates/xcl/src/gpu/dxil/geometry_tests.rs:geometry_inputs_with_heap_windows_validate, the test program ofgeometry_forms_validatereading one ES input (v9), translated with 1 window, 4 root windows and 4 heap windows, wave64 and split. Without the change it fails with the error above, forwindows 0x104.Tested
XCL_ADAPTER=Radeon; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.8.2502.11; debug for the tests, release for the runs.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4onc1e6807:main9633138on each adapter (run with the same filter):shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatoranddevice_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaaon both, plusrecomp::tests::gpu_image_get_resinfo_past_last_levelandfuzz_tests::fuzz_validate_and_gpu_1on RDNA2.SKIPPED: RTX 4070 Ti: the wave64 cases of thelower/lower_dxilGPU tests,gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64). RDNA2: the mesh-shader tests,gpu_geometry_direct_recordsamong them. Both:heap_window_out_of_memory_falls_back_to_the_switch_form,pso_measurement_compiles_an_exact_synthetic_record(no Developer Mode),test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state, and thelower_dxilf16 / f32 cases the direct backend refuses.xcl shaders shaders.rpf --direct --sample 0 --windows 260 --validate:main: GS 232 of 390 translated (158 refused with the error above). CS 2689 / 2689, MS 9282 / 9282, PS 12101 / 12101 and VS 2236 / 2236.Regression run
RTX 4070 Ti (driver 621.40), release builds, 60 s each,
scripts/smoke.ps1 -Game <folder> -Title retail-titleon the newer retail title, run one after the other from the same shell, with the same settings. The runs stay on the menus, so they're a regression check only: they don't show a heap-window geometry shader being translated.main9633138(this PR's base) and this PR's head (no uncommitted changes):main:
PR:
Not tested
gpu_geometry_direct_records) runs one window only, and its program reads no inputs. This change only affects heap mode.AI use