public static class SpirvNamesWhat a name in an OpName is allowed to be.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
OpName is debug information that decides whether a shader runs. SPIR-V itself does not care what anything is called — validation passes either way. But a SPIR-V module is rarely the last step: MoltenVK cross-compiles it to Metal Shading Language, D3D12 backends to HLSL, and both take variable names from these very strings. A name that is an ordinary identifier in Raven and a keyword in the language downstream produces source that will not compile, and the failure arrives as vkCreateComputePipelines … ErrorInitializationFailed with no mention of a name.
The word that found this was and. Raven lowers a && b into a local so that b can be skipped, and called it that; C++ — and therefore MSL — spells && as and too, so bool and = …; is a syntax error, and every shader with a short-circuiting operand that needs guarding failed on Apple hardware. The GLSL backend never saw it, because GLSL has no alternative operator spellings and its own sanitiser (Identifier) covered the rest.
So the list here is deliberately not GLSL's. It is the words that are legal in Raven and legal in GLSL and illegal in C++: the alternative operator tokens, and the handful of C++ keywords GLSL does not reserve. Anything GLSL reserves is already handled where it matters, and duplicating it here would be a second list to keep in step.
Methods (1)
public static string Of(string name)The name to put in an OpName, which is the given one unless it is a hazard.
Used by (2)
- SpirvModuleVixen.Raven
- SpirvNameTestsVixen.Raven.Tests