Commit Graph

27 Commits

Author SHA1 Message Date
STL1te 6b36c050fe style: drop the branch's code comments per CONVENTIONS.md
Only the lines this branch added lose their comments; the commits before
keep them, with the reasoning behind each change, for whoever digs into
that code later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:25:29 +03:00
STL1te 119560206d feat(agc-driver): heap ranges the host imports did not take are mirrored
An address-based build maps every readable registered range. A heap
range past APS5_HOST_IMPORT_MIB (or refused by the driver) was copied by
every such build: about 3200 ranges, 670 MiB and 500 ms per build on the
story-mode load, which then stalled. Such ranges are now served by
persistent host-cached mirrors, as the main image is, and the load
reaches its next failure.

- a heap mirror keeps no shadow; it keeps a write-tracking generation
  per 64 KiB block and a build copies only the blocks stamped since. The
  generation is stored by the copy, so a build that throws before it
  leaves no block marked current with stale bytes
- the build gathers its heap mirrors, sorts them and collects each run
  of adjacent ranges once (a collect costs about 4 us whatever its size;
  ~3000 mirrors took 16 ms per build, now about 3 ms)
- writable ranges are mirrored too: each build keeps the bytes its merged
  written ranges held at upload and write-back stores only what the GPU
  changed from them, so a CPU store made meanwhile stays; recorded work
  writing a range completes before a refresh reads it
- the mirrors are limited by APS5_HEAP_MIRROR_MIB (24 GiB by default); a
  mirror past it, or one whose buffer the driver refuses, stops the
  process. Heap mirrors are not given to descriptor sub-ranges, image
  mirror serials or reusable direct regions
- past APS5_ADDRESS_COPY_MAX_MIB (64 MiB by default) of committed bytes
  still copied, a build stops the process, naming the largest ranges and
  why each is copied (unreadable pages, an image mirror the driver
  refused, a range outside the write-watched arena, mirrors disabled)
- a direct memory page mapped at several addresses is read-only in every
  view while its range stays writable: copies, descriptor regions and
  mirrors take every readable page, write-back stores the writable ones
  and fails on a GPU change inside a read-only page instead of dropping it
- a store through the BDA table into a mirrored or copied range faults
  as before (only writable ranges imported in place are writable there);
  the fault now names the table range and that rule
- the BDA resource tests run with a storage range limit that holds the
  fault buffer and cover a mirror's fill, reuse, per-block refill, an
  interrupted refresh, a descriptor store beside a concurrent CPU store,
  and the copy limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:22:23 +03:00
STL1te c8913314bc test(agc-driver): the graphics and BDA device tests link and run to the end
Both suites stopped at their first stale expectation, so nothing after
it ran; the BDA device tests did not link.

- the BDA device tests define the one recorder entry Resources.cpp
  reaches (no recorder) and fail loudly on the others
- Buffer::Invalidate refuses memory that is not host mapped again (lost
  in 8a69fef); the device tests expect it for a device-local buffer
- APS5_PIN_WAIT_MS (60000 by default, unchanged) bounds the wait before
  a mutation of a leased range is refused, and the refusal names it; the
  graphics tests set 200 ms, as they expect about a dozen refusals
- the expectations follow the behaviour the code chose since: a buffer's
  four-DWORD V# is refused as a T#, a sampler exceeds the mock's zero
  sampler slots, a V# at unmapped memory binds its committed pages only,
  a rect-list fragment input without a vertex export reads as zero,
  detiled rows span the padded block width, mip ranges are checked in
  address order, block-compressed and 128/129/132 formats use render
  target tiling, an XOR swizzle is refused only over a base that is not
  64 KiB aligned, DCC and partial mip chain views decode, a cube reads as
  a 2D array, the sampler fixture's max LOD fits the 4.8 field, a BDA
  program with barriers is accepted, a tessellation control stage is
  refused, a corrupt request fails on its signature and a newer one on
  its version
- the DCC comment in the texture decoder no longer claims metadata
  compression is refused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:22:23 +03:00
STL1te 3d3f71224e feat(shader): V#s at address 0 access nothing
A V# with records but a base address of 0 threw at bind time ("null shader
buffer descriptor address"), although a shader that never reaches that slot
works on hardware; an access through it would fault there, so a working
title does not make one.

Such a V# is specialized empty like one without records (every access out of
bounds) and binds the placeholder buffer; the draw cache's alias check skips
it as the build does. The tests expecting the old rejections are dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:22:20 +03:00
STL1te 2476bfda56 feat(agc-driver): depth/stencil and mip-chain targets, more color formats
- Depth/stencil: draws that test depth or stencil against a bound surface
  render with a GPU-only depth/stencil attachment (DepthSurface), cleared
  to DB_DEPTH_CLEAR/DB_STENCIL_CLEAR when made. Z test/write/function and
  per face the stencil function, operations and masks (BACKFACE_ENABLE);
  replacements by another value where Vulkan's single reference can carry
  them. Clear and copy draws, add/sub other than 1, array or mip views
  and MSAA throw, and texture reads of a surface's memory are refused.
  Scaleform menus mask with the stencil (REPLACE 0, ADD_CLAMP, EQUAL);
  their masked content was skipped before.
- Mipmapped color targets render through the resident image of the whole
  chain with a view of the mip, so mips in the packed tail are drawn too;
  CB_COLOR_VIEW's mip level is read from bits 26-29 (GFX10).
- Color: SNORM targets, UNORM16/SNORM16 exports, one-component formats
  honouring COMP_SWAP (A8), 32_R/32_GR/32_AR exports, linear rows padded
  to 256 bytes, BLEND_BYPASS.
- INDIRECT_BUFFER jumps are followed when copying a submission; thin 3D
  textures in display and rotated XOR swizzles; only the bytes the GPU
  changed are written back; resource registration.
- VideoOut: a flip stalls the GPU queue while the flip queue is full and
  holds the submitter back.
- APS5_DUMP_FRAMES_EVERY dumps every k-th presented frame.
- The graphics test target builds again (missing sources, a hand-aligned
  64 KiB buffer, stale expectations updated) and gains DepthStencilTests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:22:15 +03:00
Dean Galvin 0479a5f5f0 fix(agc): reject primitive restart only for indexed draws
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-28 16:49:29 +13:00
devilismyfriend 29b4601564 perf(agc): dispatch and draw recipes, data-only cache hits, unit shadows, bindless image tables
Dispatch cache with per-key value variants and data-only hits (flat-SRT leaves the recompiler
proves pure are refreshed into the resource template instead of re-captured), dispatch and draw
recipes replaying a proven prepare, register-keyed draw entries, template data refresh, unit
shadows in device-local slabs, 64 KiB block-unit storage tracking with windowed detile, DCC
clear-key proofs, per-class GPU timing, a CPU copy path with batch read tracking, present slot
ring, rate-limited reaps and lazy completion counting, plan-failure and poisoned source memos,
bindless image tables (runtime-indexed descriptor arrays from a CPU-read table) so the
per-frame compute program that failed its plan now compiles. Worker affinity opt-in, per-draw
logs behind APS5_TRACE_DRAWS, wait-timeout reports include the recorder's view of the label.
Fixes a use-after-free behind BDA-miss dispatch snapshots and the CPU-write stamp of
UnchangedSinceCollected. Intro-video stage: 154 -> ~500 presents per 10 s at 4K.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-26 19:00:40 -07:00
boykopovar fa6d023b1b feat(agc): support rendertarget64kb shader textures 2026-09-24 11:18:35 +03:00
boykopovar f129f6cde5 fix(agc): accept valid hardware screen offset values 2026-09-23 16:22:20 +03:00
boykopovar 069ee78158 feat(shader): generate tessellation shaders for rect-list primitives 2026-09-23 16:13:33 +03:00
boykopovar bbde0f4680 feat(agc): support tiled color target layout 2026-09-23 13:15:30 +03:00
boykopovar 8cd216e9d7 fix(agc): remove raw buffer restriction and decode guest buffer descriptors 2026-09-23 11:44:46 +03:00
boykopovar b521e1f811 test(agc): add texture resource and detiling coverage 2026-09-23 10:57:27 +03:00
boykopovar 77f44a1a8d refactor(agc): report unimplemented image/sampler resources 2026-09-22 21:51:35 +03:00
boykopovar f7aaa2fb86 feat(agc): add DRAW_INDEX_AUTO handling impl 2026-09-22 20:07:09 +03:00
boykopovar 79c9aa587b feat(agc): add fragment shader barycentric support 2026-09-22 11:43:39 +03:00
boykopovar 5e3a13041c feat(agc): implement vertex attribute input and buffer binding 2026-09-22 11:34:54 +03:00
boykopovar 5b424406a5 fix(agc): enable float controls and validate subgroup capabilities 2026-09-22 11:23:58 +03:00
boykopovar 3028c87491 feat(agc): add bda memory mapping and resource management (wip) 2026-09-21 18:54:06 +03:00
boykopovar 1490c0386c refactor(agc): unify shader resource bindings and push constants 2026-09-21 13:48:44 +03:00
boykopovar 9c78d10044 fix(agc): support unrestricted vulkan depth range 2026-09-16 07:24:00 +03:00
boykopovar f0b13b6652 fix(agc): support negative depth range and inactive color targets 2026-09-16 07:21:13 +03:00
boykopovar 05ec432f75 fix(agc): non-homogeneous positions with all viewport transforms enabled 2026-09-16 07:11:00 +03:00
boykopovar f73834ce2f fix(agc): complete initial context state and tighten shader validation 2026-09-16 07:04:23 +03:00
boykopovar 74613f7e0f feat(agc): extend graphics compiler contract and add mesh and tessellation paths 2026-09-15 21:19:06 +03:00
boykopovar 215e3cbf48 fix(agc): fix missing register at DWORD 677 (wip) 2026-09-15 12:38:01 +03:00
boykopovar 77b96978c7 feat(agc-driver): add strict vulkan indexed draw pipeline 2026-09-15 12:28:25 +03:00