Renderer · const
SKIN_PALETTE_TEXTURE_UNIT
The joint palette, read by the vertex stage.
Explained in Hello world.
const SKIN_PALETTE_TEXTURE_UNIT: numberimport { SKIN_PALETTE_TEXTURE_UNIT } from '@driftengine/core';In depth
It comes out of the same sixteen as everything above it, and that is the correction. The
palette was first given unit 0 on the reasoning that MAX_VERTEX_TEXTURE_IMAGE_UNITS is a
separate guarantee of sixteen from MAX_TEXTURE_IMAGE_UNITS. Those two do bound the stages
separately — but they bound how many units each stage may reference, not how the units are
numbered: activeTexture selects from one shared pool, so unit 0 is the directional shadow map
whoever binds it. The result is GL_INVALID_OPERATION: two textures of different types use the same sampler location, on a frame that otherwise draws.
Found on hardware rather than in review, which is the whole reason a capture is part of the work. WebGPU never had it: its bindings are per bind group and carry no shared namespace.
What it costs is one of the five units left after the IES atlas. What would make it wrong is
the lit pass growing past sixteen, which textureUnitBudget.test.ts asserts against.