shader: lower measured narrow integer render target exports #2384
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2392"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T15:02:17Z.
Change
Refs #1999 (F) and #2378. Uncompressed gfx1013 integer pixel exports now accept the remaining measured narrow views: R8 and RG8 UINT/SINT, R16, RG16 and RGBA16 UINT/SINT, and R10G10B10A2_UINT. The shader writes a matching 32-bit integer SV_Target. The output merger clamps each component to the width of its destination. For the mixed-width view this gives RGB limits of 1023 and an alpha limit of 3. Compressed integer exports and the unverified three-channel R32 integer formats retain their refusals. DXGI format definitions.
The normal MRT fixture queues the eleven views of the same synthetic shader for one pending scan. It checks the compiled output signature, the exact little-endian bytes and a simultaneous red UNORM target. The mixed-width input
ffff7ffe 00000021 00000235 00000104yields bytesff 87 50 e3; the deliberately masked shader yieldsfe 87 50 23. A second compiled control checks low-half truncation against signed RGBA16 saturation.Verification
ff0000ff. Server 2025 WARP measurements with the debug layer.b105847c,python -B tests/startup_mrt_check.py <consumer> <warp|hardware> <fxc|dxc> <dxc.exe> <fxc.exe>passed all four local combinations using the matching measurement build of the C++ fixture. WARP 10.0.26100.9711 took 26.24/25.76 s (FXC/DXC). RTX 4060, driver 32.0.15.9579, took 45.27/45.43 s. Each run reached all 11 new results and the existing final floating-point check. The local D3D12 debug layer was unavailable. The focused Windows Server 2025 build of the exact commit passed all three CTests without skips; both compilers reported all 11 narrow-target results and the three-channel refusal with the D3D12 debug layer enabled. Focused WARP build and CTest log.python -B tests/startup_gfx2hlsl_export_mask_check.py,python -B tests/startup_gfx2hlsl_refusals_check.py,python -B tests/docs_links_check.py,python -B tests/bidi_controls_check.pyandgit diff --checkpassed. The portable export check verifies the integer signatures and covers compressed-export refusal for each typed integer view.The fixtures extend the in-tree source-generated shaders under the repository license. The measurements cover desktop D3D12 translation. Native guest readback remains open.
AI assistance: Codex, GPT-6.2 Astra (xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T16:02:26Z.
APPROVED: Measured narrow integer render target exports (R8/RG8/R16/RG16/RGBA16 UINT/SINT + R10G10B10A2_UINT). Independent cross-platform verification across three adapters with 198 matching pairs. Test fixtures well-documented with WARP + hardware validation.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:39:36Z.
Review: COMMENTED
Review of head
b105847c(comment only).Checked:
tools/startup/gfx2hlsl.py:VERIFIED_UINT_RTVS/VERIFIED_SINT_RTVSgrow to the 8/16-bit and R10G10B10A2 views. They stay subsets of the existingUINT_RTVS/SINT_RTVS, so the refusal path and the 32-bit output code are unchanged. The three-channel R32G32B32 formats remain refused and are now pinned by the test.tests/startup_gfx2hlsl_export_mask_check.py: the typed-target table is now data driven over all 21 formats. Expected signature and store text come from the format suffix. Every integer format also checks that a compressed (packed) export is refused.tests/startup_mrt_check.pyandtests/startup_stream_setup.h: eleven new views go through the D3D12 fixture with an exact byte readback and a simultaneous UNORM target. This is a real GPU-readback test, so it fits the rule for shader lowerings. It is registered asstartup_mrt_<compiler>_<backend>in CMake, so Win2025 runs it on WARP.docs/startup-runtime.md: now matches the code, including the remaining refusals.Commands run locally:
git diff --stat origin/main...HEADpython3 -I tests/startup_gfx2hlsl_export_mask_check.py("0 failed")python3 -I tests/startup_gfx2hlsl_refusals_check.pypython3 -I tests/docs_links_check.pygh pr list --repo R0Y00/Xbox2Windows --state all --search "integer render target export narrow R8 R16 UINT"No blocking findings. The WARP result for the new formats comes from the Win2025 run below. Next: update with main, CI, Win2025 WARP dev+release receipt.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:53:39Z.
Win2025 WARP receipt for head
55f9d550after updating with main.Note: the pipeline's default py-check list includes tests/startup_run_sh_check.py, a POSIX launcher check that exits 77 (skipped) on Windows. It was left out; every other check ran.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
55f9d550aaf9d2e96b543906014c40a927be2c6e:--preset dev):cmake --build --preset dev --target cpu_placed_provider d3d12_xs_device_obj d3d12_xs_shim startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2):20.26s(configure1.81s)ctest --preset dev -R 'startup_mrt|startup_stream' --parallel 4 --no-tests=error --output-on-failure): 21/21 passed (39.09s:startup_mrt_dxc_warp29.56s,startup_mrt_fxc_hardware29.73s,startup_mrt_dxc_hardware29.67s,startup_mrt_fxc_warp29.86s,startup_stream_fetch_hardware1.53s,startup_stream_fetch_warp1.53s,startup_stream_viewport_warp1.04s,startup_stream_request_warp1.27s,startup_stream_draw_warp3.17s,startup_stream_interface_warp1.09s,startup_stream_rasterizer_warp1.11s,startup_stream_rasterizer_ignore_warp1.15s,startup_stream_depth_warp4.24s,startup_stream_fetch_translate0.41s,startup_stream_interface_translate0.38s,startup_stream_interface_hardware1.11s,startup_stream_viewport_hardware1.20s,startup_stream_rasterizer_ignore_hardware0.96s,startup_stream_rasterizer_hardware1.04s,startup_stream_draw_hardware3.17s,startup_stream_depth_hardware4.02s)/O2(--preset release):cmake --build --preset release --target cpu_placed_provider d3d12_xs_device_obj d3d12_xs_shim startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2):39.11s(configure6.67s)ctest --preset release -R 'startup_mrt|startup_stream' --parallel 4 --no-tests=error --output-on-failure): 21/21 passed (30.58s:startup_mrt_dxc_hardware22.22s,startup_mrt_dxc_warp22.27s,startup_mrt_fxc_hardware22.49s,startup_mrt_fxc_warp22.58s,startup_stream_request_warp1.24s,startup_stream_fetch_warp1.32s,startup_stream_fetch_hardware1.29s,startup_stream_viewport_warp1.06s,startup_stream_draw_warp3.10s,startup_stream_interface_warp0.96s,startup_stream_rasterizer_warp1.17s,startup_stream_interface_translate0.43s,startup_stream_depth_warp4.21s,startup_stream_fetch_translate0.39s,startup_stream_rasterizer_ignore_warp0.97s,startup_stream_interface_hardware0.96s,startup_stream_viewport_hardware1.24s,startup_stream_rasterizer_hardware1.02s,startup_stream_rasterizer_ignore_hardware0.91s,startup_stream_draw_hardware3.06s,startup_stream_depth_hardware3.79s)tests/mesh_heap_sampler_check.pyok (0.5s),tests/startup_buffer_address_check.pyok (0.3s),tests/startup_compute_request_offline_check.pyok (0.4s),tests/startup_compute_translate_check.pyok (0.2s),tests/startup_flat_param_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.1s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.5s),tests/startup_gfx2hlsl_capture_check.pyok (0.7s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.2s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.3s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.1s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.0s),tests/startup_gfx2hlsl_f32_nan_check.pyok (4.1s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.1s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.1s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.1s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.1s),tests/startup_gfx2hlsl_refusals_check.pyok (0.3s),tests/startup_gfx2hlsl_root_check.pyok (0.6s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.1s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.2s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.1s),tests/startup_gfx2hlsl_shift64_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (3.3s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (0.6s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_swap_check.pyok (0.2s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (3.5s),tests/startup_gfx2hlsl_watch_check.pyok (2.3s),tests/startup_image_2d_array_check.pyok (0.2s),tests/startup_image_3d_check.pyok (0.1s),tests/startup_image_gather_lz_check.pyok (0.5s),tests/startup_image_load_d16_check.pyok (0.7s),tests/startup_image_sample_a16_check.pyok (0.1s),tests/startup_image_sample_b_check.pyok (0.1s),tests/startup_image_sample_c_check.pyok (0.2s),tests/startup_image_sample_l_check.pyok (0.2s),tests/startup_image_sample_lod_check.pyok (0.1s),tests/startup_inline_sampler_check.pyok (0.1s),tests/startup_run_ps1_check.pyok (8.1s),tests/startup_sampler_heap_check.pyok (0.1s),tests/startup_smem_address_check.pyok (0.1s),tests/startup_stream_fetch_check.pyok (0.2s),tests/startup_stream_interface_check.pyok (0.2s),tests/startup_translator_check.pyok (0.3s)sccache: 4/34 hits; wall138.1sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T18:20:02Z.
I reran the narrow MRT checks on the updated head
ce054dfc6551832eebd35c608d15fb0db7233ab3. Windows Server 2025 WARP passed all three CTests in both Debug and Release with the debug layer enabled. Each preset produced 11 exact MRT readbacks with FXC and 11 with DXC, including the concurrent UNORM target. The three-channel refusal and the FLOAT reference also passed. Build and test logs.