Reuse the pipeline and resident texture across BC7 mip-tail draws #118
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/119"
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 PrivacyOnion on 2026-11-21T16:33:53Z.
Change
check_bc7_tailexercises the translated copy shader's implicit LOD clamping across all requested mip viewports (0 .. firstResident + levels.size() - 1) against the same resident SRV range (MostDetailedMip = firstResident,MipLevels = residentCount). Previously, it calleddraw_verifiedonce per requested mip level, recreating the root signature, graphics PSO, constant buffer, descriptor heaps, multi-mip default-heap BC7 texture and staging upload buffer on each iteration.draw_verifiednow builds the root signature, pipeline state, constant buffer, descriptor heaps and resident multi-mip texture once per invocation, uploads the resident mip chain on the first command list, and loops over the requested viewport draws and readbacks.tools/bc7_tiles.pyalso precomputes the 16-entryXandYblock swizzle bit tables used bylinearize_4k_s. Refs #15.Verification
Built and verified at
d355fc3on Windows 11 with VS Build Tools 2022 17.14 (MSVC 19.44.35228.0), Windows SDK10.0.26100.0, Python3.12, on bothNVIDIA GeForce RTX 5070(vendor=10de device=2f04, driver32.0.16.1664,debug_layer=enabled) andMicrosoft Basic Render Driver(WARP,vendor=1414 device=008c, driver10.0.26100.9818,debug_layer=enabled):bcpack_prefix_and_mip_tail: passed (3 tests in 0.022s).pixel_aot_hardware&pixel_aot_warp: passed (pixels=4096 channels=16384 max_absolute_error=0,debug_errors=0 debug_warnings=0, negative channel-swap and constant-buffer mismatch controls rejected).bc7_draw_hardware&bc7_draw_warp: passed all 8 requested mip viewports (requested_mip=0..7,sampled_mip=3..7,max_absolute_error=0,debug_errors=0 debug_warnings=0, and middle-mip corruption rejected).Evidence and follow-up
No new fixture files were added; existing synthetic BC7 Mode 6 and pixel shader fixtures verify identical pixel readback and negative-control rejection before and after the change.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:16:12Z.
Please rebase the renderer changes on the merged dual-texture path from #100 and show that its positive and swapped-binding controls still pass alongside the mip-tail corruption control.
Imported from R0Y00/Xbox2Windows. Originally posted by PrivacyOnion on 2026-11-21T17:35:04Z.
Rebased onto
main(retainingsecondRows,secondTexture/secondStaging, the 2-descriptor SRV heap, andcheck_dual_pixelfrom #100) and verified that the positive dual-texture cases (forward,reverse,reuse), the--dual-pixel-swappedbinding control, the swapped-weight control, and the BC7 mip-tail middle-mip corruption control all pass on hardware (RTX 5070) andWARP: