public readonly record struct VertexLocationsWhich location a vertex stage reads each of its attributes from.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The number is the shader's, not the renderer's, and that is the whole reason this type exists. A renderer knows its vertex struct — the field order, the formats, the byte offsets — and cannot know where the stage it was handed reads them, because that is a property of the source. Raven's StreamPlan locates a stage's own parameters after the shader's streams, so position is location 0 in a shader with no streams and location 3 in one with three, and adding a stream renumbers every attribute under it.
⚠ Getting it wrong is not a validation error. A pipeline whose vertex layout names a location the stage does not declare simply binds nothing to that attribute, and the stage reads whatever the driver left there — a mesh drawn with its normals in the colour slot, on one driver, silently. Which is why this is passed rather than assumed, and why the count is checked.
The default is 0, 1, 2, … in declaration order, which is what glslc output has and therefore what every caller handing over hand-written GLSL wants. So a renderer that is given nothing behaves exactly as it did before there was anything to give.
Where the numbers come from is Vixen.Shaders.Generators: a shader's .reflect.json carries its vertex inputs, and the generator emits a …Location constant per attribute beside the …Set and …Binding ones.
Fields and properties (2)
public int CountHow many were supplied, or zero for declaration order.
public uint this[int index]The location of the attribute at in declaration order.
Methods (2)
public VertexLocations(params ReadOnlySpan<uint> locations)Locations in the renderer's own attribute order.
public void Require(int expected, string name)Throws when a caller supplied a number of locations that is not this renderer's number of attributes.
Used by (10)
- LineRendererVixen.Rendering
- LineShadersVixen.Rendering
- MeshInstanceRendererVixen.Rendering
- MeshInstanceShadersVixen.Rendering
- MeshRendererVixen.Rendering
- MeshShadersVixen.Rendering
- SurfaceGeometryTestsVixen.Rendering.Tests
- SurfaceVertexVixen.Rendering
- UiRendererVixen.Ui.Renderer
- UiShadersVixen.Ui.Renderer