AGC: Cohtml UI in Heretic + Hexen (PPSA26525) and DOOM + DOOM II (PPSA21444) shows black squares and clipped text: a fill of the stencil plane never reaches the host depth image #7130

Closed
opened 2026-10-17 12:50:17 +00:00 by JosepBove · 0 comments
JosepBove commented 2026-10-17 12:50:17 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by JosepBove on 2026-10-17T12:50:17Z.


Heretic + Hexen (PPSA26525 01.003.000, #5912) and DOOM + DOOM II (PPSA21444 03.000.000, #5921) draw their menus with Cohtml's Renoir backend. On main c9e6c45de every dialog shows black 64 px squares and text cut off mid-word: in Heretic's "add players" dialog, "player settings" is drawn as "pla", "continue..." as "c", and "Waiting for player..." as "ing for player...", with two black blocks below the dialog. It reproduces unchanged since main 84b01f9cd (the captures and breakpoints below were taken there), is deterministic, and is unchanged by APS5_NO_GPL, APS5_NO_HOST_IMPORT, APS5_NO_TEXTURE_CACHE, APS5_NO_TEXTURE_HASH, APS5_SYNC_TEXTURE_UPLOAD, APS5_NO_WRITE_WATCH and APS5_NO_RESIDENT_TARGETS.

How the UI is drawn (RenderDoc 1.46 captures of the dialog, replayed draw by draw): Renoir keeps the UI in a persistent 1920x1080 R8G8B8A8 layer with a D32_SFLOAT_S8_UINT target (both loaded, never cleared by a render pass). Each frame a depth-only pass writes stencil Replace ref 2 inside the dirty rectangles, the UI draws test stencil Equal 2, and a full composition frame draws with Always/Keep ref 1. Replaying a composition frame renders correctly; replaying the next frame reproduces the corruption at its fourth draw, because the stencil already holds an L-shaped region of 2 left by earlier dirty rectangles. No draw ever writes the stencil back to 1.

What resets it on the console: before each frame the title fills the whole stencil plane with 1. Breakpoints on DepthSurfaceView and NoteDepthMetadataFill show, every frame:

NDMF addr=...0e400000 bytes=0x280000 pattern=0x01010101
DSV target: addr=...0d400000 stencil=...0e400000 w=1920 h=1080 fmt=130 htile=...0b300000 htileStencil=0

0x280000 is DepthSliceBytes({1920, 1080}, 1), the stencil plane of that target. NoteDepthMetadataFill only acts on a fill that covers DB_HTILE_DATA_BASE (HtileFillCovers), so this fill updates guest memory and nothing else: the resident DepthSurface image keeps the stencil values of every earlier frame. Regions still at 2 from earlier dirty rectangles let later Equal 2 draws paint where the title did not mean to (the black squares, the UI's background quads), and regions that never returned to 1 block the text draws of the next composition frame (the clipped words).

The same fill mechanism also writes depth planes (0x870000 bytes = DepthSliceBytes({1920, 1080}, 4) with 0xff000000) and HTILE (0x30000 bytes with 0xfffffff0) for other targets in these titles; those are not part of this report.

Setup: Windows 11 Home 26200, AMD Ryzen 9 9950X3D, NVIDIA RTX 5090 (616.92), WinLibs GCC 15.2.0 r7, Release. Both titles relinked with --windows --registry, ANYPS5_GPU='RTX 5090'.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5898498424 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7130). Originally posted by [JosepBove](https://github.com/JosepBove) on 2026-10-17T12:50:17Z. --- Heretic + Hexen (PPSA26525 01.003.000, #5912) and DOOM + DOOM II (PPSA21444 03.000.000, #5921) draw their menus with Cohtml's Renoir backend. On `main` c9e6c45de every dialog shows black 64 px squares and text cut off mid-word: in Heretic's "add players" dialog, "player settings" is drawn as "pla", "continue..." as "c", and "Waiting for player..." as "ing for player...", with two black blocks below the dialog. It reproduces unchanged since `main` 84b01f9cd (the captures and breakpoints below were taken there), is deterministic, and is unchanged by `APS5_NO_GPL`, `APS5_NO_HOST_IMPORT`, `APS5_NO_TEXTURE_CACHE`, `APS5_NO_TEXTURE_HASH`, `APS5_SYNC_TEXTURE_UPLOAD`, `APS5_NO_WRITE_WATCH` and `APS5_NO_RESIDENT_TARGETS`. How the UI is drawn (RenderDoc 1.46 captures of the dialog, replayed draw by draw): Renoir keeps the UI in a persistent 1920x1080 `R8G8B8A8` layer with a `D32_SFLOAT_S8_UINT` target (both loaded, never cleared by a render pass). Each frame a depth-only pass writes stencil `Replace` ref 2 inside the dirty rectangles, the UI draws test stencil `Equal` 2, and a full composition frame draws with `Always`/`Keep` ref 1. Replaying a composition frame renders correctly; replaying the next frame reproduces the corruption at its fourth draw, because the stencil already holds an L-shaped region of 2 left by earlier dirty rectangles. No draw ever writes the stencil back to 1. What resets it on the console: before each frame the title fills the whole stencil plane with 1. Breakpoints on `DepthSurfaceView` and `NoteDepthMetadataFill` show, every frame: ``` NDMF addr=...0e400000 bytes=0x280000 pattern=0x01010101 DSV target: addr=...0d400000 stencil=...0e400000 w=1920 h=1080 fmt=130 htile=...0b300000 htileStencil=0 ``` `0x280000` is `DepthSliceBytes({1920, 1080}, 1)`, the stencil plane of that target. `NoteDepthMetadataFill` only acts on a fill that covers `DB_HTILE_DATA_BASE` (`HtileFillCovers`), so this fill updates guest memory and nothing else: the resident `DepthSurface` image keeps the stencil values of every earlier frame. Regions still at 2 from earlier dirty rectangles let later `Equal` 2 draws paint where the title did not mean to (the black squares, the UI's background quads), and regions that never returned to 1 block the text draws of the next composition frame (the clipped words). The same fill mechanism also writes depth planes (`0x870000` bytes = `DepthSliceBytes({1920, 1080}, 4)` with `0xff000000`) and HTILE (`0x30000` bytes with `0xfffffff0`) for other targets in these titles; those are not part of this report. Setup: Windows 11 Home 26200, AMD Ryzen 9 9950X3D, NVIDIA RTX 5090 (616.92), WinLibs GCC 15.2.0 r7, Release. Both titles relinked with `--windows --registry`, `ANYPS5_GPU='RTX 5090'`. AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#7130
No description provided.