This repository was archived by the owner on Oct 28, 2026. It is now read-only.
Repository navigation
Conversation
… as reused memory Unity reuses the memory of transient render targets: in FPV Simulator (PPSA10698) an RGBA8 1920x1080 color texture is sampled at the address that a D32S8 surface's stencil plane occupied earlier. The lookup found the stencil plane and threw "sampling the stencil plane ... is not implemented", which ended the presentation. 9d65003 made depth-plane views in a format that cannot hold the plane fall through to the ordinary texture path. A stencil-plane view whose texels are not one byte wide cannot hold the 8-bit stencil plane either, so it now falls through the same way. AI-assisted: yes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
Owner
Author
|
Merged upstream as boykopovar#3277 (carried unchanged by @oneandonlydean, authorship kept). |
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
FPV Simulator (PPSA10698 v01.006.000, Unity 2021.3 URP) ends when it presents a frame:
Unity reuses the memory of transient render targets. The T# base, 0x231590000, is the stencil plane of the D32S8 surface at 0x230cd0000, and the first line shows the title binding that address as a color target. The view is a 1920x1080 RGBA8 sRGB texture, which reads the color data, not an 8-bit stencil plane.
9d65003 (boykopovar#1495) already treats this as memory reuse for the depth plane: a view with another extent, or a depth-plane view in a format that cannot hold the plane, falls through to the ordinary texture path. Stencil-plane views of the same extent kept the old handling: they all went to the depth surface, which throws for any format other than R8 uint. This applies the same rule to the stencil plane: a view whose texels are not one byte wide cannot hold the 8-bit plane, so
DepthSurfaceTexturereturns nothing and the memory is read like any texture.Related: boykopovar#454 (open) is broader: it retires a depth surface once another writer covers its depth or stencil plane. This PR extends only the format rule from boykopovar#1495 and doesn't track writers. Both change the same lines in
DepthSurfaceTexture, so whichever lands second needs a small rebase.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release, RTX 5070 Laptop (driver 616.92).
DepthSurfaceReuse.cpp(agc_driver_graphics), on a 320x180 D32S8 surface: an R8 uint view of the stencil plane still samples the plane; RGBA8 and R32F views of the same extent are read as reused memory. Without the source change,agc_driver_graphicsfails on the RGBA8 case with the original error:sampling the stencil plane of depth surface 0x60000000 (320x180, vk format 130) as a 320x180 texture of guest format 56 (vk 37) ... is not implemented.agc_driver_graphics,agc_driver_depth_bias_per_face,agc_driver_pending_exact_surface,agc_driver_prepared_graphics,agc_driver_cmask_fast_clear,agc_pass_hazards): 6/6.agc_driveron NVIDIA RTX 5070 Laptop: 253/253.check_conventions.pypasses.mainwith other patches.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code
Upstream issue: boykopovar#2994