Skip to content

video_core: preserve coherence across aliased images - #4773

Open
cuesta4 wants to merge 1 commit into
shadps4-emu:mainfrom
cuesta4:codex/warp-effect
Open

video_core: preserve coherence across aliased images#4773
cuesta4 wants to merge 1 commit into
shadps4-emu:mainfrom
cuesta4:codex/warp-effect

Conversation

@cuesta4

@cuesta4 cuesta4 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

PS4 applications can bind the same guest surface memory through image descriptions with different extents or Vulkan-compatible formats. The texture cache represented these bindings as independent host images, so writes performed through one alias were not consistently visible through the others. Asynchronous readbacks could also overwrite newer guest writes with stale GPU data. This caused missing post-processing effects, stale render-target contents, and incorrect composition in titles such as God of War III Remastered.

Fix

Track compatible images sharing the same guest address as a coherent alias group with an authoritative backing image, pending writer, and generation counters. Synchronize contents through explicit Vulkan image copies and barriers, supporting both complete coverage and compatible partial intersections. Track asynchronous readback pages by generation so invalidated guest pages are not overwritten, and invalidate non-coherent download allocations before host reads. Alias copy compatibility is isolated as a pure operation shared by the runtime and offline tests.

Testing

Fixes God of War III Remastered's hidden chest effects and hyper-exposure bug.

image image before3 after3

@cuesta4
cuesta4 force-pushed the codex/warp-effect branch from 9572a65 to d47db5e Compare July 30, 2026 01:15
@Randomuser8219

Copy link
Copy Markdown
Contributor

This does the exact same thing that #4770 does,

@cuesta4
cuesta4 force-pushed the codex/warp-effect branch from d47db5e to 33aa93f Compare July 30, 2026 01:29
@cuesta4

cuesta4 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

This does the exact same thing that #4770 does,

No, it doesn't.

And I had a previous PR (#4708) which fixed the exposure first, but I closed it because this is a better implementation.

@cuesta4
cuesta4 marked this pull request as ready for review July 30, 2026 01:38
@cuesta4
cuesta4 force-pushed the codex/warp-effect branch from 33aa93f to c21d1f0 Compare July 31, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants