fix(spirv): implement 8- and 16-bit global stores #536
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!536
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/global-narrow-writes"
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?
What
The SPIR-V backend still threw
NotImplementedExceptionforWriteGlobalU8/S8/U16/S16. A mesh program that usesSTG.U8/S8/U16/S16therefore failed to translate. This is the same failure class as theLoadGlobalS16crash reported in #192: the program is left out and the game goes on to dereference a null resource (CRASH: ... read 0x100000000150, guest 0x150).The load half (
LoadGlobalU8/S8/U16/S16) is already in main fromc3459dc. This change completes the store half: the aligned 32-bit word is changed in place with a compare-exchange loop, as the storage buffers' narrow stores already do. A plain load/store pair would lose another invocation's half of the word; the console's byte-enabled store does not.Test
tests/global_load_16_ir.cppnow emits signed and unsigned 8/16-bit stores at offsets 0, 2, 3 and at a page end, and checks the compare-exchange loop, the bit-field insert and the helper call. The fixture also keeps the existing load cases.Shader::NotImplementedException: SPIR-V Instruction is not implemented (WriteGlobalS16) is not implemented.spirv-val --target-env vulkan1.3.Not AMD-specific
The
LoadGlobalS16failure in #192/#351 appears on NVIDIA as well; the owner confirmed it in #351. The RX 580/570 in #192 also lacks mesh shaders, which is a separate rendering limitation (507b95bwarns about it). The crash signature in the attached log is the shader-translation failure, not a vendor-specific GPU path. The later report of VRAM exhaustion after ~10 seconds is a separate issue (#105).Refs #192.
The
appimagecheck fails onmaintoo (the packaging workflow's AppImage step), so it is not from this change. The relevant checks are green:Game-free source regressionson Ubuntu and Windows, and theSPIR-V global narrow load/store loweringjob (real IR,spirv-val, and the new store cases). This is the store half of the narrow-global family for #192; the load half is already inmainatc3459dc.