Commit Graph

16 Commits

Author SHA1 Message Date
Scramblrrrr d5a396d927 fix(shader): preserve aliased embedded fetch attributes 2026-10-10 07:22:51 -03:00
Adrià 5bcbbeb449
Merge pull request #2371 from fisherjoey/fix/scanner-s-bfe-u32
fix(recompiler): apply the S_BFE_U32 width when the vertex fetch scanner folds constants
2026-10-10 08:16:16 +02:00
Celegans12 fcc5105aeb fix(shader): count folded draw offsets once in the vertex and instance indices
When the embedded vertex fetch adds the base vertex or start instance
user SGPR to the index VGPR, the driver folds that SGPR into the draw's
first vertex and first instance. v5/v8 were gl_VertexIndex and
gl_InstanceIndex, which already include it, so the translated add
counted it twice, on direct draws and CPU-path indirect records alike.
The entry of a vertex or local program now subtracts the folded SGPR's
user data word from the builtin, which gives the zero-based indices the
hardware has. A record drawn in place on the GPU keeps the CPU's word,
so the fetch analyzer counts the SGPR as shared unless the fetch add is
the only reader of v5/v8 and the SGPR (no earlier access or EXEC write,
no carry, clamp, second add or other write of the SGPR); such records
take the CPU path. The fold moves into Driver::FoldDrawOffsets,
ClassifyIndirectDraw becomes public for the test, and the env switches
that skipped the fold go.
2026-10-09 18:41:51 +02:00
Joey Fisher f00c2f2d16 fix(recompiler): apply the S_BFE_U32 width when the vertex fetch scanner folds constants 2026-10-09 10:37:40 -06:00
Chad 4e888083f9 feat(shader): implement s_getreg_b32 for the MODE round mode fields
SOPK 0x12 threw in the decoder. The recompiler emits round to nearest
even, which s_setreg_imm32_b32 already requires, so reads that stay
within MODE bits 0..3 return 0. Other hardware registers and fields
throw with the register and bits read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 18:11:59 -05:00
Dean b44b308c53
Merge pull request #333 from adriadam10/feat/sopk-misc
feat(shader): implement s_cmovk_i32, s_version and s_setreg_imm32_b32
2026-10-05 11:41:47 +13:00
Dean 6a4bbade0d
Merge pull request #435 from adriadam10/feat/vop3-mad-i64-i32
feat(shader): implement v_mad_i64_i32
2026-10-04 22:54:49 +13:00
Dean 13cbbfa7f7
Merge pull request #325 from adriadam10/feat/relative-indexing
feat(shader): implement v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32
2026-10-04 22:54:32 +13:00
Adrià Franch e1b7ecc1c5 feat(shader): implement v_mad_i64_i32
Decode VOP3b 0x177 and translate it next to v_mad_u64_u32: the high half of
the product comes from SMulHi, and the carry-out is the sign of the exact
sum (bit 64 of the sign-extended product plus the sign-extended addend), as
measured on RDNA2 hardware.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 09:17:12 +02:00
Adrià Franch f994cc6ab7 feat(shader): implement s_cmovk_i32, s_version and s_setreg_imm32_b32
s_cmovk_i32 writes the sign-extended 16-bit immediate when SCC is set.
s_version is a no-op marker. s_setreg_imm32_b32 takes its value from a
literal dword and is ignored like s_setreg_b32; both are now listed as
silent stubs in TechnicalDebt.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:26:58 +02:00
Adrià Franch 01bae4dd79 fix(shader): track the multi-register destinations of the quad SAD ops in vertex fetch analysis
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:23:37 +02:00
Adrià Franch 1b7e0e487e feat(shader): implement v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32
v_movrelsd moves VGPR[src + M0] to VGPR[dst + M0]. The _2 form and
v_swaprel take the source offset from M0[9:0] and the destination
offset from M0[25:16]; v_swaprel and v_swap exchange the two registers.
They reuse the select-over-registers lowering of v_movrels/v_movreld,
now shared as readRelativeVector/writeRelativeVector.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-03 11:37:02 +02:00
Adrià Franch 3033e5e554 feat(shader): implement s_movrels/s_movreld (b32, b64) and s_movrelsd_2_b32
s_movrels reads SGPR[src + M0] and s_movreld writes SGPR[dst + M0].
The 64-bit forms align the offset down to even (M0 & ~1), and
s_movrelsd_2_b32 takes the source offset from M0[9:0] and the
destination offset from M0[25:16], as measured on hardware. They use
the same select-over-registers lowering as the vector forms, over the
106 SGPRs. The embedded vertex-fetch scan forgets every tracked SGPR on
a relative write.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-02 09:59:59 +02: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 5ad0305def feat(shader): add embedded vertex fetch for translator impl 2026-09-16 15:32:13 +03:00
boykopovar d084eed394 feat(shader): rdna memory op decoder impl 2026-09-15 07:07:50 +03:00
Renamed from core/shader/recompilier/Translation/src/EmbeddedVertexFetch.cpp (Browse further)