You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AGC: an RGBA8 texture over a depth surface's stencil plane stops FPV Simulator ("sampling the stencil plane ... is not implemented") #2994
FPV Simulator (PPSA10698 v01.006.000, Unity 2021.3 URP) ends on Windows when it presents a frame:
[gpu] color target 0x231590000 stays non-resident: AGC graphics: storage image access to depth/stencil surface 0x231590000 is not implemented
[videoout] presentation failed: AGC graphics: sampling the stencil plane of depth surface 0x230cd0000 (1920x1080, vk format 130) as a 1920x1080 texture of guest format 130 (vk 43), tile mode 7, dimension 1, levels 0-0, slice 0 is not implemented (T# 02315900 c8200000 010dc1df 91b00fac 00000000 00700000 00000000 00000000)
terminate called after throwing an instance of 'std::runtime_error'
Cause
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 texture is a 1920x1080 RGBA8 sRGB view of the same extent, so it reads the color data, not an 8-bit stencil plane.
Since 9d65003 (#1495), DepthSurfaceTexture treats a depth-plane view in a format that cannot hold the plane as reused memory and falls through to the ordinary texture path. Stencil-plane views kept the old handling: every same-extent view of the stencil plane goes to the depth surface, and Sampled throws for any format other than R8 uint.
Fix
AlxcBTW/AnyPS5#26 (a1827af1, on main57f96fd). A stencil-plane view whose texels are not one byte wide now falls through to the ordinary texture path, like 9d65003's rule for the depth plane. 8-bit views keep their current handling. Full CI, with the change merged into main3cb317f, passed on Linux, macOS and Windows. I can't open it as a PR while intake is limited, so it's here if a collaborator wants to cherry-pick it.
#454 (open) is broader: it retires a depth surface once another writer covers its depth or stencil plane. Both change the same lines in DepthSurfaceTexture.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, RTX 5070 Laptop.
New cases in DepthSurfaceReuse.cpp (agc_driver_graphics): an R8 uint view of a D32S8 surface's stencil plane still samples the plane; RGBA8 and R32F views of the same extent are read as reused memory. Without the source change the RGBA8 case throws the same sampling the stencil plane ... is not implemented error.
Non-GPU tests 446/446, agc_driver on NVIDIA 253/253, check_conventions.py passes.
In-game: not re-run on this branch. The stop above is from a local build of main with other patches.
Activity