sharpemu/tests/SharpEmu.ShaderCompiler.Tests
kuba d809f84491
[SpirvTranslator] Share one EXEC test across a run of vector ALU writes (#1040)
A vector register write is modelled as select(EXEC, result, old value), so the
old value of every register the shader writes stays live across the write. That
guard is the translator's largest per-instruction cost: dropping it altogether
(wrong results) takes Silent Hill's volumetric-fog compute from 13.43 to 10.64
ms, and the exec-full analysis can only prove 194 of its 875 instructions run
with every lane set.

A run of instructions whose only effect is their vector destination can instead
run inside one if (EXEC). The masked-off lanes skip the whole run, which is what
the hardware does to them anyway, and only the join needs the old values. A run
stops at anything the wave runs even where this lane is masked off: SALU is not
EXEC masked and every invocation keeps its own copy of the scalar registers, a
compare writes VCC or EXEC (GFX10 keeps that destination in the instruction's
control, not in its destination list), a cross-lane read needs its neighbours to
have run, and LDS, memory and the DPP encodings reach outside the register. Six
instructions is where the branch starts paying for itself.

Compute only: the same grouping made the deferred lighting pixel program 28%
slower (11.03 -> 14.11 ms per scope), where a wave already runs with helper
lanes. SHARPEMU_EXEC_RUN=0 turns it off, SHARPEMU_EXEC_RUN_MIN sets the length.

Silent Hill title menu, same build, SHARPEMU_EXEC_RUN=0 vs on:
  offline replay min ms   fog D5DF9DC46C4E35EA  13.42 -> 12.21 (-9.0%)
                          FFT 674E5A7163897BC9  16.37..17.38 -> 17.06 (flat)
                          NGG B482CD3A01A37F0F   0.494 ->  0.492 (unchanged)
  in-game ms per dispatch fog D5DF9DC46C4E35EA  16.59 -> 15.34 (-7.5%)
                          FFT 674E5A7163897BC9  13.81 -> 13.77
                              2BFB24830D8FCFAA   4.78 ->  4.58 (-4%)
  in-game ms per scope    848AFAD7/9D180B8A     11.03 -> 11.36 (unchanged SPIR-V)
                          F987C1A4/379BE850      1.90 ->  1.72 (unchanged SPIR-V)

spirv-val passes on the fog, FFT and NGG modules; the menu image is unchanged
with Anita present.
2026-10-07 10:52:01 +02:00
..
Resources [SpirvTranslator/Vk] Cheaper guest buffer loads and f16 conversion, gated on device probes (#1035) 2026-10-07 10:51:57 +02: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
Gen5BarrierMemoryScopeTests.cs [SpirvTranslator] Cut emulated-wave64 and private-LDS overhead in translated shaders (#1034) 2026-10-07 10:51:52 +02:00
Gen5CodeEndTests.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +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
Gen5ExecFullAnalysisTests.cs Unity fixes 1016p1 (#1043) 2026-10-06 18:43:21 +03:00
Gen5ExecRunTests.cs [SpirvTranslator] Share one EXEC test across a run of vector ALU writes (#1040) 2026-10-07 10:52:01 +02:00
Gen5FlatMemoryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5Float16ArithmeticTests.cs [SpirvTranslator/Vk] Cheaper guest buffer loads and f16 conversion, gated on device probes (#1035) 2026-10-07 10:51:57 +02:00
Gen5ImageTests.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +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] Shader fixes (#1019) 2026-10-04 01:17:02 +03:00
Gen5MoveRelativeOffsetsTests.cs Astrobot / Demon's soul performance improvement (#955) 2026-09-30 18:14:21 +03:00
Gen5MultiplyHighTests.cs Des dcc fixes (#1000) 2026-10-01 21:15:55 +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
Gen5PrivateLdsTests.cs [SpirvTranslator] Cut emulated-wave64 and private-LDS overhead in translated shaders (#1034) 2026-10-07 10:51:52 +02:00
Gen5ScalarAbsoluteTests.cs Fix/gen5 shader resource handling (GTA 5) (#1015) 2026-10-03 04:00:32 +03:00
Gen5ScalarAddImmediateTests.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +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 [SpirvTranslator] Cut emulated-wave64 and private-LDS overhead in translated shaders (#1034) 2026-10-07 10:51:52 +02:00
Gen5ShaderTrapTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5SharedMemoryBarrierTests.cs Des dcc fixes (#1000) 2026-10-01 21:15:55 +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 Perf computed shaders (#1013) 2026-10-03 04:49:43 +03: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
Gen5Wave64HalfMaskAnalysisTests.cs Des dcc fixes (#1000) 2026-10-01 21:15:55 +03:00
Gen5WaveMaskLaneFlagTests.cs [SpirvTranslator] Cut emulated-wave64 and private-LDS overhead in translated shaders (#1034) 2026-10-07 10:51:52 +02:00
Gen5XorAddTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gfx10UnifiedFormatTests.cs Astrobot / Demon's soul performance improvement (#955) 2026-09-30 18:14:21 +03:00
IrControlFlowTests.cs Shader cfg ssa (#707) 2026-07-31 01:43:28 +03:00
RuntimeValueValidatorTests.cs Perf computed shaders (#1013) 2026-10-03 04:49:43 +03:00
SharpEmu.ShaderCompiler.Tests.csproj Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00