sharpemu/tests/SharpEmu.ShaderCompiler.Met...
kuba 0368b76d6c [ShaderCompiler] Fix the SOPK immediate width and S_ADDK_I32's SCC
Two things were wrong in the SOPK forms, in both the SPIR-V and the MSL
backend.

S_CMPK_*_U32 compares against SIMM16 zero-extended; only the signed compares
sign-extend it. Both translators sign-extended it for every compare, so
"s_cmpk_le_u32 s4, 0xffff" was true for any value at all. NGG geometry
programs use exactly that test on the packed vertex and primitive count, so
they took their no-primitive path and exported a single null primitive, which
left Unreal's volume passes empty. The register S_CMPK names is also only
read, yet user-data liveness recorded it as a definition, so a compare on a
user-data register left that register unloaded; it now counts as a use, as
does the register of the SOPK accumulations.

S_ADDK_I32 is defined as D.i = D.i + signext(SIMM16) with SCC set on signed
overflow, the same SCC rule as S_ADD_I32, which both backends already
implement. Neither wrote SCC for the SOPK form, so a following
S_CBRANCH_SCC0/1 or S_CSELECT read whatever the previous instruction had left
there. S_MOVK_I32 and S_MULK_I32 correctly leave SCC alone.
2026-09-29 23:19:26 +02:00
..
Goldens Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
FakeGuestMemory.cs [Gpu] Metal backend: complete IGuestGpuBackend implementation on AppKit + Metal (#283) 2026-07-18 20:32:00 +03:00
Gen5ComputeFixtures.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5MslF16CompareTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Gen5ScalarAddImmediateMslTests.cs [ShaderCompiler] Fix the SOPK immediate width and S_ADDK_I32's SCC 2026-09-29 23:19:26 +02:00
GlobalMemoryRegisterTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MetalNative.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MetalRuntimeTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MslFloat16ArithmeticTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MslGoldenTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MslTranslationTests.cs Amd fix opcode nid filecache wave32 (#903) 2026-09-24 15:00:42 +03:00
SharpEmu.ShaderCompiler.Metal.Tests.csproj Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00