The color/depth alias collapse heuristic at get_framebuffer_layout()
picks depth whenever depth_test_enabled or stencil_test_enabled is set.
But test means read, not write - so deferred renderers that run a
Z-prepass and then a G-buffer pass with depth-test ON, depth-write OFF,
color-write ON get classified as a depth pass even though they're
writing color. The color writes get silently dropped.
In Starhawk this killed every lit surface - characters, skybox, anything
that goes through the deferred lighting path rendered black or
invisible. Terrain, particles, and emissive geometry kept working
because they don't go through that same pipeline.
Fix is to check writes instead of tests:
if (zeta_write_enabled && !color_write_enabled)
keep_as_depth(); // Z-prepass, shadow gen
else
keep_as_color(); // G-buffer / lit pass
For the both-writes case I went with color since losing color is much
more obvious visually than losing depth (the engine's Z-prepass usually
still has the depth around).
Tested with Starhawk [BCUS98181] in menu and gameplay - before: missing
characters and sky. After: matches PS3 reference. Logged every aliasing
event during a couple minutes of gameplay and they were all the G-buffer
pattern (depth-test ON, depth-write OFF, color-write ON), all handled
right. The depth-keep branch wasn't actually exercised in Starhawk, but
it's there for games that do use a Z-prepass to an aliased buffer.
Fixes #11877.
|
||
|---|---|---|
| .ci | ||
| .github | ||
| 3rdparty | ||
| bin | ||
| buildfiles | ||
| darwin/util | ||
| rpcs3 | ||
| Utilities | ||
| .clang-format | ||
| .editorconfig | ||
| .gdbinit | ||
| .gitignore | ||
| .gitmodules | ||
| BUILDING.md | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| git-clang-format | ||
| LICENSE | ||
| objdump.cpp | ||
| pre-commit.readme | ||
| README.md | ||
| rpcs3.sln | ||
| usertype.dat | ||
RPCS3
The world's first free and open-source PlayStation 3 emulator/debugger, written in C++ for Windows, Linux, macOS and FreeBSD.
You can find some basic information on our website. Game info is being populated on the Wiki. For discussion about this emulator, PS3 emulation, and game compatibility reports, please visit our forums and our Discord server.
Support Lead Developers Nekotekina and kd-11 on Patreon
Contributing
If you want to help the project but do not code, the best way to help out is to test games and make bug reports. See:
If you want to contribute as a developer, please take a look at the following pages:
You should also contact any of the developers in the forums or in the Discord server to learn more about the current state of the emulator.
Building
See BUILDING.md for more information about how to setup an environment to build RPCS3.
Running
Check our friendly quickstart guide to make sure your computer meets the minimum system requirements to run RPCS3.
Don't forget to have your graphics driver up to date and to install the Visual C++ Redistributable Packages for Visual Studio 2022 if you are a Windows user.
License
Most files are licensed under the terms of GNU GPL-2.0-only License; see LICENSE file for details. Some files may be licensed differently; check appropriate file headers for details.