sharpemu/tests/SharpEmu.Libs.Tests/Agc
shadowbeat070 a158960c20
feat(gpu): GPU compute detile for guest tiled textures (Vulkan + Metal) (#592)
* feat(gpu): GPU compute detile for guest tiled textures (Vulkan + Metal)

Move RDNA2 exact-XOR deswizzle (swizzle modes 5/9/24/27, 4bpp) off the CPU
onto a GPU compute pass. GnmTiling.GetDetileParams resolves the shared
addressing into DetileParams; the CPU fallback and both GPU kernels consume
the same params so they never disagree.

Vulkan (verified bit-exact on NVIDIA): SpirvFixedShaders.CreateDetileCompute
hand-emits the SPIR-V kernel; VulkanDetilePass.RecordDetile records the
dispatch into the async batch command buffer (never a blocking submit on the
render thread) with transients retired via fence; VulkanDetileSelfTest
(SHARPEMU_DETILE_SELFTEST=1) checks both entry points against the CPU detile.

Metal (Mac-untested): detile_compute.msl (detile_cs) + MetalDetilePass mirror
the Vulkan pass. The active Metal path CPU-detiles via the new
GnmTiling.DetileWithParams when a texture arrives packaged (empty RgbaPixels +
TiledSource/Detile), keeping Metal correct under default-on with no regression;
wiring MetalDetilePass live is the remaining on-device step.

Flags: GPU detile is default-on (SHARPEMU_GPU_DETILE=0 disables);
[GPU-DETILE] diagnostics gated behind SHARPEMU_LOG_GPU_DETILE=1.

Tests: 17 detile unit tests pass, incl. DetileWithParams and GetDetileParams
each matching TryDetile bit-for-bit across all supported modes/bpp, plus a
SPIR-V structural-validity test.

* feat(gpu): GPU compute detile for guest tiled textures (Vulkan + Metal)

Move RDNA2 exact-XOR deswizzle (swizzle modes 5/9/24/27, 4bpp) off the CPU
onto a GPU compute pass. GnmTiling.GetDetileParams resolves the shared
addressing into DetileParams that the CPU fallback and both GPU kernels
consume, so they never disagree; everything else keeps the CPU path.

Vulkan (verified bit-exact on NVIDIA): SpirvFixedShaders.CreateDetileCompute
hand-emits the kernel; VulkanDetilePass.RecordDetile records into the async
batch command buffer (never a blocking submit on the render thread) with
transients retired via fence, falling back to CPU detile on failure.
VulkanDetileSelfTest (SHARPEMU_DETILE_SELFTEST=1) checks both entry points.

Metal (Mac-untested): detile_compute.msl + MetalDetilePass mirror the Vulkan
pass; the active Metal path CPU-detiles via GnmTiling.DetileWithParams so it
stays correct under default-on. Wiring MetalDetilePass live is a follow-up.

Flags: default-on (SHARPEMU_GPU_DETILE=0 disables); diagnostics behind
SHARPEMU_LOG_GPU_DETILE=1. Adds 17 passing detile unit tests.

* Fix: added support layered texture support for the GPU-Detiling.

* Fix: Added support for BlockTable (1 / 4 / 8 (Morton/Z-order))

* feat: added support for 8 and 16 bpp (bytes per element)

* Fixed a build failure specific to this branch

---------
2026-07-24 20:13:02 +03:00
..
AgcEventQueueTests.cs [HLE] Fix POSIX condition variable semantics (#113) (#223) 2026-07-16 00:24:05 +03:00
AgcPredicationTests.cs [VideoOut] Add Bink2 support via FFMPEG bridge (#527) 2026-07-22 21:41:41 +03:00
AgcResourceOwnerTests.cs [VideoOut] Add Bink2 support via FFMPEG bridge (#527) 2026-07-22 21:41:41 +03:00
AgcTextureTransportTests.cs fix(gpu): support Gen5 flat memory and 3D images (#587) 2026-07-24 15:44:58 +03:00
AgcWaitRegMemTests.cs [VideoOut] Add Bink2 support via FFMPEG bridge (#527) 2026-07-22 21:41:41 +03:00
DetileComputeSpirvTests.cs feat(gpu): GPU compute detile for guest tiled textures (Vulkan + Metal) (#592) 2026-07-24 20:13:02 +03:00
Gen5FmaMixSpirvTests.cs Shader: lower VOP3P V_FMA_MIX_F32/LO/HI (was dropping Unity HDR shaders) (#466) 2026-07-20 14:37:40 +03:00
Gen5ScalarMemoryFallbackTests.cs [Tests] Isolate Gen5 scalar fallback test from parallel static mutation (#488) 2026-07-21 12:59:03 +03:00
Gen5ShaderAtomicDecodeTests.cs [AGC] Implement RDNA2 buffer/image/DS 32-bit atomic instructions (#222) 2026-07-16 17:28:39 +03:00
Gen5ShaderDecoderBoundaryTests.cs shader: allow larger bounded Gen5 programs (#514) 2026-07-22 14:46:15 +03:00
Gen5ShaderProgramTests.cs perf(shader): cache pixel export masks (#288) 2026-07-17 04:17:39 +03:00
Gen5SpirvAtomicTranslationTests.cs [AGC] Implement RDNA2 buffer/image/DS 32-bit atomic instructions (#222) 2026-07-16 17:28:39 +03:00
Gen5VertexInputSpirvTests.cs [ShaderCompiler/Vulkan] Match vertex input numeric types (#351) 2026-07-18 03:01:01 +03:00
Gen5WaveMaskSpirvTests.cs Shader: test a wave mask consumed as a per-lane predicate at the lane bit (#465) 2026-07-20 14:18:20 +03:00
GnmTilingDetileTests.cs feat(gpu): GPU compute detile for guest tiled textures (Vulkan + Metal) (#592) 2026-07-24 20:13:02 +03:00