Repository navigation
v1.1.1 — output that compiled but rendered wrong
Fix output that compiled cleanly but rendered wrong, plus output naming and speed.
Found by installing the result in Unity and by diffing recompiled assembly against the original DXBC — every one of these passed a syntax check:
- Matrices are read column-major, the way Unity uploads them. A row-major read transposed every transform and sent W to 0 (the HoldShader ribbon flew off screen).
- Comparisons emit the all-ones mask DXBC actually writes (-1), not 1. The ramps that feed the result through
iadd/itof— the classic "which interval is this value in" pattern — depend on that sign, so every such ramp came out inverted (the gray background inUI/Pause Planets). sincoswith a null first target was dropped whole (the cosine vanished), and each target now takes its own mask.- The MVP collapse no longer erases world-position writes, and output registers are zero-initialised (Unity X3578).
- Variants are paired by intersection, so no combination is emitted with a single stage (X3501).
- Samplers are named from the shader's own property table instead of the pass tags — previously every sampler came out as an unbound
t0. - Indexable temps are declared
static(X3025 on write). - The GLSL path maps
roundEvenandgl_VertexID/gl_InstanceID. - A truncated type table is reported as bad data instead of overrunning the buffer.
Also in this release:
- File names are the shader name with only the hierarchy separators replaced (
UI/Pause Planets→UI_Pause Planets.shader); when a resource path is already claimed the file is named after the shader rather than getting an opaque path id. - Parallel export — shaders are processed concurrently, and every name/path claim is resolved up front so repeated runs produce identical trees. A 418-shader game body decompiles in ~6 s on 8 cores.
--dedupkeeps one copy per shader when several data files ship the same one, preferring the copy with a fixed container path.scripts/usc_validate.pyre-checks a whole output tree with Unity's ownUnityShaderCompiler(real CGIncludes, real keyword sets): 418 shaders / ~1.4k variants in ~25 s on 8 processes.
Verification: every variant of all 418 shaders compiles under UnityShaderCompiler 6000.3.10f1 with zero failures; the self-built samples (ExtremeFlow 1328 instructions, VariantMonster 60 variants / 84,425) round-trip with 0 untranslated instructions.