AnyPS5/core/libs/prx/libSceAgcDriver/Graphics/include
AlxcBTW 18d9874a06 feat(shader): give reads the masked-select pass keeps the whole pixel ancillary word
A packed ancillary word that still reaches an export, or any other read
the masked-select pass cannot drop, no longer stops the recompile. After
that pass every remaining use gets the composed word: the primitive class
at bits 0-1, SampleId at bits 8-11 and Layer at bits 16-28, with every
other bit zero. Those lanes do export the ancillary VGPR on the console,
so the word has to be right, not just present.

The primitive class (0 point, 1 line, 2 triangle, 3 rectangle) comes from
the draw. RasterPrimitiveOf maps rect lists to 3, line lists on the vertex
path to 1 and everything else the driver accepts to 2, because its
geometry and tessellation paths only output triangles. It reaches the
shader as pipeline specialization constant 8233, the way dual-source
blending does: a request field that is folded into the specialized
module and is part of the result memo, the draw key and the serialized
request (version 17).

Only shaders that read the class pay for it. ShaderInfo records the read
(disk cache format 28), and only those shaders put the class in their
module key, so a shader that reads just the sample or layer field keeps
one module for every primitive class. The draw sets the class only when
the pixel shader loads the ancillary VGPR, so other draws keep the draw
cache entries they have today.

The VRS rates (bits 2-5) and the eye id (bit 7) are 0 because the driver
supports neither VRS nor multiview. SampleId is 0 because the driver
rejects MSAA and per-sample shading, and Layer is 0 while it ignores
vertex layer exports. TechnicalDebt.md records the layout sources and
these assumptions.

Tests:
- pixel_ancillary builds an export to target 0 whose two channels select
  between a packed value and a phi carrying the word. It checks the word
  for each primitive class, sample and layer, checks that the three
  shapes the masked-select pass keeps now compile with the composed word,
  and that a program whose select the pass drops reads no class.
- agc_driver_pixel_ancillary_word exports the word from a draw and reads
  back 2, 3 and 1 for triangle, rectangle and line. A shader that reads
  only the sample field shares one module across the classes, and the
  whole-word shader gets one per class. It also checks RasterPrimitiveOf.
- agc_shader_memory covers the version 17 round trip, and
  agc_shader_disk_cache the new flag.

Both ancillary tests fail with the old refusal when the composition is
disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 13:06:21 +13:00
..
BdaResources.hpp style: drop the branch's code comments per CONVENTIONS.md 2026-09-29 21:25:29 +03:00
BufferPool.hpp fix(agc): reclaim idle buffers on allocation OOM 2026-10-11 15:50:46 +02:00
ColorTargetLayout.hpp feat(agc): support 64 KiB display XOR color targets 2026-10-12 22:38:59 +03:00
ColorTargetTransfer.hpp feat(agc): support tiled color target layout 2026-09-23 13:15:30 +03:00
Context.hpp fix(agc): choose host memory from the heap budget instead of retrying 2026-10-12 09:13:34 -03:00
DccMetadata.hpp fix(agc): expand comp-to-single DCC keys in a DCC decompress pass 2026-10-11 01:38:27 +02:00
DepthSurface.hpp fix(agc): take an HTILE fill from a value in memory as a depth fast clear 2026-10-13 12:40:24 +13:00
Draw.hpp perf(agc): keep the highest index of a large in-place index buffer while it is unchanged 2026-10-12 11:19:50 +13:00
GpuColorTransfer.hpp feat(agc): present 16-bit float display buffers 2026-10-11 00:38:12 +02:00
GuestBufferMemory.hpp Merge pull request #3425 from oneandonlydean/up4/fix-3158-span-limit 2026-10-11 12:35:57 +02:00
GuestSamplerResource.hpp fix(agc): pick float or integer sampler border colours from the paired images 2026-10-10 21:57:09 -04:00
GuestTextureResource.hpp fix(agc): decide ANISO_OVERRIDE single-level images from the T#'s own levels 2026-10-10 10:57:02 +02:00
HalfFloatScanout.hpp feat(agc): present 16-bit float display buffers 2026-10-11 00:38:12 +02:00
MultisampleTarget.hpp fix(agc): guest access to a multisampled color target's memory throws 2026-10-11 23:41:30 +02:00
ParallelCompare.hpp perf(agc): compare large stale draw snapshots on helper threads 2026-10-10 23:55:38 +13:00
PassHazards.hpp feat(agc): render pass hazard tracker 2026-10-10 23:27:18 +13:00
Pipeline.hpp perf(agc): prebuild each stage's library alone and keep two descriptor sets with pipeline libraries 2026-10-12 09:50:41 +02:00
PipelineCache.hpp feat(agc): persistent shader disk cache and Vulkan pipeline cache 2026-09-30 12:01:25 +03:00
PipelineLibrary.hpp fix(agc): retain used descriptor sets in pipeline libraries 2026-10-13 00:38:10 +04:00
PipelineSpecialization.hpp fix(shader): validate and serialize pipeline specialization constants (wip) 2026-10-08 17:28:35 +03:00
PlaceholderImages.hpp fix(agc): typed image heaps on devices without nullDescriptor 2026-10-11 10:32:49 +02:00
Recorder.hpp fix(agc): keep a host import dropped mid-hold for every batch that hold opens 2026-10-12 10:30:13 +02:00
Resources.hpp fix(agc): give pooled buffers a VkBuffer of exactly the requested size 2026-10-10 15:25:21 +01:00
Sampler.hpp fix(agc): pick float or integer sampler border colours from the paired images 2026-10-10 21:57:09 -04:00
ShaderInputState.hpp Merge pull request #3738 from Mouad-Scriptz-0/feat/agc-merged-vertex-tables 2026-10-11 23:56:46 +02:00
ShaderResources.hpp perf(agc): describe pipeline set layouts from the compiled shaders alone 2026-10-12 09:50:41 +02:00
Shaders.hpp perf(agc): give each graphics stage a fixed push constant slot with pipeline libraries 2026-10-10 12:19:31 +02:00
State.hpp feat(shader): give reads the masked-select pass keeps the whole pixel ancillary word 2026-10-13 13:06:21 +13:00
Texture.hpp feat(agc): depth planes sampled as 2D arrays, cubes and integer views 2026-10-13 12:11:02 +13:00
TextureCache.hpp perf(agc): keep render targets on gpu across draws 2026-09-24 21:30:00 +03:00
TextureDetiler.hpp perf(agc): move storage texels between the image and its tiled bytes in one pass 2026-10-10 23:46:06 +13:00
TextureFormat.hpp fix(agc): sample 5_6_5, 1_5_5_5 and 4_4_4_4 textures in AMD's channel order 2026-10-10 11:15:42 -04:00
TextureSwizzleEquations.hpp fix(agc): lay out 3D SW_64KB_D_X textures as thick volumes 2026-10-08 18:28:19 -04:00
TextureTiling.hpp feat(agc): thick mip tails of mipmapped 3D textures 2026-10-05 21:32:06 +13:00
UnitShadow.hpp fix(agc): retire host imports before guest unmap 2026-10-10 09:35:43 +02:00
VertexInput.hpp fix(agc-driver): move indices far past every vertex fetch's records to the first zero vertex 2026-10-12 03:42:49 -04:00