mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[GH-ISSUE #4040] Title: NVIDIA-specific Post-Processing Artifact in CUSA04934 – Works in gr2fix Branch, Fails in Main #1205
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wuguo13842 on GitHub (Feb 16, 2026).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/4040
Checklist
Description
Fix the "picture-in-picture" rendering artifact in CUSA04934 on the main branch, so it behaves identically to the gr2fix branch.
The issue: A semi-transparent recursive overlay appears only on dark objects and shadows (background and UI are normal). The gr2fix branch has no such issue, proving the game is compatible.
Because the gr2fix branch already proves CUSA04934 runs perfectly, and the main branch is the core development branch containing the latest features and optimizations. Making the main branch run this game correctly would:
Eliminate the need for branch switching – users can stay on main for better compatibility and performance.
Validate main branch code quality – demonstrating its rendering backend is as reliable as gr2fix.
Pave the way for similar games – this fix may resolve analogous issues in other games relying on post-processing effects.
Simply put: gr2fix already works – main should too.
Reason
https://github.com/w1naenator/shadPS4/tree/gr2fix
Issue Description:
CUSA04934 runs perfectly on the gr2fix branch but exhibits a persistent "picture-in-picture" artifact when running on the main branch. The gr2fix branch already demonstrates that the game can run correctly; fixing this issue in the main branch would make it perfect.
The artifact manifests as a recursive, semi-transparent overlay that only appears on dark objects and shadows, while bright areas (sky, UI) render correctly.
Why This Matters:
The gr2fix branch already proves that:
The game is fully playable
All rendering passes work correctly
The post-processing pipeline functions as intended
The main branch should achieve the same level of correctness. Resolving this issue would bring the main branch to feature parity with gr2fix for this title.
Technical Analysis (from main branch captures):
Using RenderDoc captures, we have determined:
Root Cause: The game uses a multi-pass pipeline where a compute shader processes depth/lighting information and writes to an intermediate image (Frame image #0 or #1). A subsequent full-screen quad (EID 20, 50) samples this image and blends it onto the swapchain.
What Works Correctly (after fixes):
Vertex transformation: uScale = (0.0015625, 0.0027777778) and uTranslate = (-1, -1) correctly map screen-space vertices (0-1280, 0-720) to NDC.
UV coordinates: Vertex data shows UV range [0,1] (see attached dump).
Push constants are correctly propagated (confirmed via logging).
What Fails (main branch only):
The sampled image (Frame image #0 in EID 20) appears to contain depth or shadow information from the current frame, rather than properly processed post-process data. This causes the artifact only where depth values are present (dark areas).
Vertex Data (EID 20, main branch):
text
VTX, IDX, aPos.x, aPos.y, aUV.x, aUV.y
0, 8, 0.00, 0.00, 0.00, 0.00
1, 9, 1280.00, 0.00, 1.00, 0.00
2, 10, 1280.00, 720.00, 1.00, 1.00
3, 8, 0.00, 0.00, 0.00, 0.00
4, 10, 1280.00, 720.00, 1.00, 1.00
5, 11, 0.00, 720.00, 0.00, 1.00
Steps to Reproduce (main branch):
Launch CUSA04934 using the main branch.
Observe the rendered scene; a recursive "picture-in-picture" effect is visible on dark objects and shadows.
Switch to the gr2fix branch—the artifact disappears completely.
Expected Behavior:
The main branch should match the gr2fix branch: no artifact, clean post-processing composition.
Attachments:
RenderDoc capture from main branch (shadps4_capture.rdc) showing EID 20 and EID 50 pipeline states.
Logs demonstrating correct push constant values in main branch.
Vertex buffer dump confirming UV range [0,1].
(Optional) Reference capture from gr2fix branch for comparison.
Environment:
GPU: NVIDIA GeForce RTX 2070 SUPER (driver 566.14)
OS: Windows
Emulator: shadPS4 (main branch vs. gr2fix branch)
Game: CUSA04934
Suggested Investigation Area:
The issue likely stems from texture cache differences between branches. The gr2fix branch may have better handling of resource aliasing or layout transitions for intermediate images. Comparing the texture cache implementation (texture_cache.cpp, image.cpp) between branches could reveal the fix.
Why the Difference?
The gr2fix branch must handle resource transitions or texture cache aliasing differently. In the main branch, Frame image #0 may be aliased with another resource, causing the compute shader's output to be overwritten or not properly flushed before the fragment shader reads it. The vertex transformation is correct; the problem is the content of the texture being sampled.
Examples
No response
@StevenMiller123 commented on GitHub (Feb 16, 2026):
This issue doesn't meet our issue reporting guidelines. Please use the GAME BUG template, and provide the information that template requests.