sharpemu/tests/SharpEmu.ShaderCompiler.Tests
kuba f4a1da601f [SpirvTranslator] Structure loops, early exits and single-block programs
Only forward, nested branches were emitted as structured control flow; every program with a
loop, and every single-block program, went through the loop around a switch on the guest PC,
which keeps all registers live and stops the host compiler from optimizing across blocks.

A block that a later block branches back to - on a wave-uniform condition or with s_branch -
now opens a SPIR-V loop whose body is structured like any range, whose continue evaluates
that branch's condition, and whose iterations share the dispatcher's step guard so a guest
loop that never ends still cannot wedge the GPU queue. A conditional branch from the body to
the block after the latch is a break out of the innermost loop. Any other backward edge, or a
break past an outer loop, keeps the dispatcher as before.

Across eight games, programs left on the dispatcher went from 760 to 104 (Poppy, Silent Hill,
Oregon Trail and Dreaming Sarah to none); every emitted module passes spirv-val and the
frames match. Octopath's 12.5M-invocation instanced draw went from 12.2 to 10.8 ms.

(cherry picked from commit 0675cfa892)
2026-09-30 14:36:40 +02:00
..
Resources Fix for DS,Little Nightmares, Little Nightmares III and Astro Bot shader (#913) 2026-09-27 20:43:07 +03:00
Gen5AlternateBufferEntryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5AlternateImageEntryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5DataShareRead64Tests.cs Amd fix opcode nid filecache wave32 (#903) 2026-09-24 15:00:42 +03:00
Gen5DataShareSwizzleTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5DataShareThreadReadTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5DataShareThreadWriteTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5DataShareWrite64Tests.cs Amd fix opcode nid filecache wave32 (#903) 2026-09-24 15:00:42 +03:00
Gen5FlatMemoryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5Float16ArithmeticTests.cs Fix for DS,Little Nightmares, Little Nightmares III and Astro Bot shader (#913) 2026-09-27 20:43:07 +03:00
Gen5ImageTests.cs Fix for DS,Little Nightmares, Little Nightmares III and Astro Bot shader (#913) 2026-09-27 20:43:07 +03:00
Gen5Int16AluTests.cs Fix for DS,Little Nightmares, Little Nightmares III and Astro Bot shader (#913) 2026-09-27 20:43:07 +03:00
Gen5InterpolationParameterTests.cs [SpirvTranslator] Use a flat input for v_interp_mov P0 on MoltenVK (#910) 2026-09-26 14:19:57 +03:00
Gen5PixelInputMappingTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5PixelOutputMappingTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5ScalarAbsoluteTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5ScalarArithmeticShift64Tests.cs test(shader): cover SAshrI64 translation (#914) 2026-09-28 02:59:51 +03:00
Gen5ScalarBitClearTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5ScalarLaneTransferTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5ShaderTrapTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5SharedMemoryBarrierTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5SignedMultiply24Tests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5SignedPack16Tests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5StructuredLoopTests.cs [SpirvTranslator] Structure loops, early exits and single-block programs 2026-09-30 14:36:40 +02:00
Gen5ThreeInputXorTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5TypedBufferLoadDecodeTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5UnsignedPack16Tests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5VopcF16Tests.cs Fix for DS,Little Nightmares, Little Nightmares III and Astro Bot shader (#913) 2026-09-27 20:43:07 +03:00
Gen5XorAddTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
IrControlFlowTests.cs Shader cfg ssa (#707) 2026-07-31 01:43:28 +03:00
SharpEmu.ShaderCompiler.Tests.csproj Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00