AnyPS5/core/libs/prx/libSceAgcDriver/Execution/include
Dean Galvin aa9a5c02a7 feat(agc): run CB fast-clear eliminate and DCC decompress passes within the DCC model
Draws with CB_COLOR_CONTROL MODE ELIMINATE_FAST_CLEAR (2) or DCC_DECOMPRESS
(6) were rejected as "only normal color rendering with copy ROP". On
hardware these full-target blits write the fast-clear value into the
fast-cleared pixels (or store the pixels uncompressed); the shader's output
never lands. In this driver's DCC model (surfaces stored uncompressed,
uniform fast-clear keys make every read return the clear value) that is:

- keys that are a clear code: the target's texels become that value and
  its keys read uncompressed. Reads see the same values before and after.
- uncompressed keys, or a target without DCC: nothing changes.
- mixed keys (per-block metadata), a mipmapped DCC target (its keys are not
  decoded) or a register clear of a texel over 64 bits: throw.

The texels go into the target's resident image (its refresh already
cleared it to a code's value; the register code is cleared on the GPU with
FillClear) and reach memory through its write-back, or into guest memory
on the CPU when there is no resident image. A resident image made under
other DCC keys is remade under the target's keys by the storage cache
before the pass reads it. DecodeColorMetadataPass
requires the draw to be only that pass: copy ROP, no depth or stencil
work, no multisampling, a viewport and scissor covering each target.
Indirect passes throw. The CB_COLOR decode moves into DecodeColorBuffer,
which also reads CB_COLOR_CLEAR_WORD0/1.

The register clear code (DCC key 0x20) had no value before: its keys were
read as the stored texels. A target under register keys now reads as its
CB_COLOR_CLEAR_WORD texel: a resident target is cleared to it before a draw
renders into it (then its keys read uncompressed), and a non-resident
target's copy starts from it.

Every decision that materializes a clear reads the keys through
CurrentDccKeys, which first waits for the batches up to the newest recorded
writer of the key range. The title's fast-clear fill of the metadata can
still be pending on the GPU when the next draw is decoded; reading the
stale bytes there made a later draw clear the target over the results of
the earlier ones.

The remaining CB modes (resolve, decompress, FMASK decompress) keep the
rejection, which now names the mode.
2026-10-01 20:59:03 +13:00
..
AspectFit.hpp feat(video): add resizable aspect-ratio-aware window 2026-09-23 14:27:47 +03:00
BdaFeatures.hpp feat(shader): implement checked BDA reads and GPU fault reporting 2026-09-21 19:26:09 +03:00
CaptureTrace.hpp debug(agc): detect gpu input buffer changes between recording and execution 2026-09-28 13:27:14 +03:00
DisplayBuffer.hpp feat(videoout): present linear framebuffer layouts 2026-09-28 09:05:49 +10:00
Driver.hpp fix(kernel): orderly shutdown when closing the display window 2026-09-28 18:30:34 +03:00
GuestMemory.hpp feat(agc): track guest memory writes on Linux with async userfaultfd write protection 2026-10-01 00:08:08 +13:00
MemoryAccessScope.hpp perf(agc): keep render targets on gpu across draws 2026-09-24 21:30:00 +03:00
PerformanceTimer.hpp refactor(agc): make frame timing logs optional by cmake option 2026-09-28 10:51:29 +03:00
Pm4.hpp fix(agc): decide a 64-bit label wait by the dwords its mask compares 2026-10-01 08:39:53 +13:00
Pm4Opcodes.hpp feat(agcDriver): add 54 PM4 execution and indirect dispatch support 2026-09-14 11:43:13 +03:00
Presentation.hpp refactor(log): remove extra logs + refactor timing logging 2026-09-24 20:35:59 +03:00
PresentationScaler.hpp perf(agc): downsample frame captures on GPU and queue disk writes 2026-09-28 13:06:15 +03:00
QueueState.hpp feat(agc): add DRAW_INDEX_AUTO handling impl 2026-09-22 20:07:09 +03:00
Recipe.hpp perf(agc): dispatch and draw recipes, data-only cache hits, unit shadows, bindless image tables 2026-09-26 19:00:40 -07:00
ShaderMemory.hpp perf(agc): dispatch and draw recipes, data-only cache hits, unit shadows, bindless image tables 2026-09-26 19:00:40 -07:00
VideoOutput.hpp style: drop the branch's code comments per CONVENTIONS.md 2026-09-29 21:25:29 +03:00
VulkanDevice.hpp feat(agc): run CB fast-clear eliminate and DCC decompress passes within the DCC model 2026-10-01 20:59:03 +13:00
WorkerSampler.hpp fix(kernel): orderly shutdown when closing the display window 2026-09-28 18:30:34 +03:00