feat(rdna2): support MIMG load/store/resinfo, bilinear, compare, and gather4 #126
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!126
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/126/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Lewandox on GitHub · 2026-11-24 11:04 UTC · original
Lewandox:feat/rdna2-mimg-load-store-sampling→main· +1064 −93 · 14 files · 2 commits · merged 2026-11-24 14:05 UTCPart of #21.
Summary
Extends 2D RDNA 2
MIMGsupport in both the reference interpreter (emu/rdna2_exec_image.py) and HLSL recompiler (emu/rdna2_hlsl_image.py) with bit-exact parity:image_load: integer(x, y)fetch with OOB returning zeros,dst_selswizzle, anddmaskpacking.image_store: integer(x, y)write with OOB no-op, full/partialdmaskread-modify-write for both32_32_32_32_FLOATand8_8_8_8_UNORM(matchingprecisefloat32-to-UNORM8 rounding), andAllMemoryBarrierWithGroupSync()in compute HLSL.image_get_resinfo: returns(width, height, 1, 1)atmip == 0and(0, 0, 0, 1)for out-of-range mips withoutdst_selswizzle.FILTER_LINEAR = 1) using explicitprecise floatintermediates in HLSL and matching float32 rounding in Python to prevent FMA drift.S#clamp modes:CLAMP_MIRROR(1),CLAMP_MIRROR_ONCE_LAST_TEXEL(3),CLAMP_BORDER(6), andCLAMP_MIRROR_ONCE_BORDER(7), plus the 3 standard border colors (BORDER_TRANS_BLACK,BORDER_OPAQUE_BLACK,BORDER_OPAQUE_WHITE).image_sample_lz,image_sample_c/image_sample_c_lz(3-register(z_ref, s, t)layout, depth compare ops0..7, point and bilinear PCF), andimage_gather4/image_gather4_lz(hardware(x0, y1), (x1, y1), (x1, y0), (x0, y0)order, single-channeldmaskvalidation, NSA support).Tests & Verification
tests/test_rdna2_image_ops.py(+20 tests: 13 CPU unit tests + 7@gpubit-exact parity tests coveringimage_load/image_store/image_get_resinfo, bilinear + mirror/border clamp modes,image_sample_c_lzPCF with NSA, andimage_gather4_lz).tests/test_rdna2_image.py(anisotropic filter) andtests/test_rdna2_exec.py(image_load_mip).578->598tests).ruff check --select W605,F,E9 PrototypeScarlett tests tools-> All checks passedpytest tests/test_rdna2_image.py tests/test_rdna2_image_ops.py tests/test_rdna2_hlsl.py tests/test_rdna2_graphics.py tests/test_rdna2_exec.py tests/test_readme_sync.py-> all CPU tests green (@gputests ready for Windows DXC/GPU CI).@Lewandox on GitHub · 2026-11-24 12:10 UTC · original
Rebased onto
main(b15d882) and addressed all blocking and non-blocking review points in30b95a5:BASE_LEVEL/LAST_LEVEL):rdna2_image.image()now decodesbase_level(bits15:12) andlast_level(bits19:16) ofSQ_IMG_RSRC_WORD3and rejects any descriptor withbase_level != 0orlast_level != 0by name (test_image_descriptor_rejects_mipmapped_levels).540encodings (matchingcoverage()on top of#129) and614automated tests.@gpucoverage: Parametrized GPU byte-for-byte parity tests across all 6 supported clamp modes (0, 1, 2, 3, 6, 7) × both filters (POINT,LINEAR), both filters × non-LZ/LZimage_sample_c, and non-LZ/LZimage_gather4.SQ_TEX_*descriptor numbering, depth compare direction, UNORM8 store rounding, and gather4 texel order.CI (
lint+pytest) is green and the PR is ready for re-review.@KainanP on GitHub · 2026-11-24 13:20 UTC · original
Essai sur NVIDIA (RTX 4060 Laptop, pilote 32.0.16.1047, Windows 11), commit
30b95a5, runtime compilé :Rien à signaler sur cette carte : toutes les comparaisons GPU/interpréteur passent octet par octet.
Essai fait avec l'aide d'une IA (Claude Code).
@LooperSalty on GitHub · 2026-11-24 11:39 UTC · original · requested changes
Review of #126 (MIMG load/store/resinfo, bilinear, compare, gather4). Changes requested.
Passing: 438 tests passed (GPU tests run, dxc present); the 5
test_native.pyfailures are the known ones and also fail on origin/main; ruff clean; 598 tests matches the README.Blocking:
rdna2_image.image()ignores the T# BASE_LEVEL/LAST_LEVEL fields (no "level" in rdna2_image.py).image_sample(implicit LOD) therefore always reads level 0 of a mipmapped texture, andimage_get_resinfoalways returns a mip count of 1. Please reject descriptors with more than one level by name (rule 3), or implement the level selection and the mip count, with a test on each.coverage()), so the row must say 532 (the combined count after #129 is 540, see the merge note).Non-blocking: cite the source for the numbering of the clamp, filter, compare and border constants (GFX10 SQ_TEX_* values), the depth compare direction, the UNORM store rounding (
floor(v*255+0.5)) and the gather4 texel order.🤖 Generated with Claude Code
@LooperSalty on GitHub · 2026-11-24 13:30 UTC · original · review (dismissed)
Les points bloquants de la revue du 11:39 sont traités dans
30b95a5(réponse du 12:10) : rejet nommé des T# à plusieurs niveaux (test_image_descriptor_rejects_mipmapped_levels), README à 614 tests et 540 encodages (cohérent avec la suite), GPU paramétré sur les modes de clamp, les deux filtres et les formes non LZ. Vérifié :test_rdna2_exec.py,test_rdna2_image.py,test_rdna2_image_ops.py,test_rdna2_graphics.py: 64 passed sur GPU et sur WARP ; suite complète sans échec hors les tests natifs liés au runtime local ; ruff propre. Les références des constantes (non bloquantes) restent souhaitables. Approuvée.