Repository navigation
Sample depth attachments through equivalent red texture views - #988
thehobbit85 wants to merge 2 commits into
Conversation
…depth storage (#988) Metal refuses a Depth32Float texture viewed as R32Float (and Depth16Unorm as R16Unorm) even with pixel-format views, and Burnout Paradise Remastered samples its D32F depth buffer through an R32F view (#985: validation abort in tex_by_id). The view now keeps the depth format, selects the requested mips and layers of the attachment, and presents (depth, 0, 0, 1) before the descriptor's channel swizzle, as NVN's red view does. t_view_swizzle covers both pairs through registration, GPU reads and samples, mip selection and later depth writes. Fixes #985 Co-authored-by: Eliran Zach <4012041+thehobbit85@users.noreply.github.com>
|
Landed on main as e58e446, with you as co-author. Thank you for the precise diagnosis and the GPU test. I took only the first commit. The geometry-hazards fixture fix is already on main (f714e13), so I dropped the cherry-picked #959 commit, which is what made this PR conflict. Checked here: the new Burnout gameplay past this point is still unverified. #985 is closed by the commit, and the reporter can reopen it if the game stops somewhere else. |
Fixes #985. Burnout Paradise Remastered registers a sampled R32F view of its D32F depth attachment. Metal rejects that cast even when the texture allows pixel-format views. Simply binding the original depth texture as colour gives the wrong channels: on an M2 Max, a depth value of 0.375 read back as (0.375, 0.375, 0.375, 1).
Keep the Metal depth format for D32F → R32F and D16 → R16 UNORM sampled views. Map the depth value to (R, 0, 0, 1) before composing the guest's channel swizzle. The view uses the selected subresources of the original attachment, so subsequent writes remain visible without copying it. Other format pairs and the stencil-only path are unchanged.
65501fbb) aborts with the exact Depth32Float/R32Float assertion from the report. With the fix,make -C dm/gfx/tests GAME=010015100B514000 check_t_view_swizzlepasses all 442 checks. The new cases exercise both formats through real NVN registration and GPU colour reads and samples. Different depths at two mips catch selection errors; a second render clear after lookup checks that the cached identity and remapped views both see the new depth.make -j5 -C dm/gfx/tests GAME=010015100B514000 run) passed with six optional external reflection samples unavailable. The Mac host built. Python: 906 tool tests (16 skipped), 200 graphics tests (26 skipped), 42 iOS packaging tests; all 11 documentation tests passed.scripts/regress.py check --games 0100DCA0064A6000,010031F019294000,0100F43008C44000,01007EF00011E000,0100A9D01C446000stopped at preflight (exit 2): there are no configured game builds or regression directories here. Burnout has no repository profile. No gameplay or iOS device run was performed; whether Burnout reaches gameplay after this abort is still unverified.Shared geometry fixture CI fix
Commit
04f25365042fapplies #959 as a separate prerequisite. On1fbf27efdd06, LLVM 23.1.4 reproduced both C lint findings in the geometry hazard fixture inherited from main. On the updated commit, LLVM 23.1.4 checked all 217 sources and matched the existing 271-finding baseline. The Mac GPU fixture passed all 65 assertions in each of three cut configurations with Metal API validation. This follow-up changes only the synthetic test. The feature validation and its limitations above still apply to the feature revision they name.