Class VertexAttributeLocations
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Resolves shader input names and buffer semantics to their .
public static class VertexAttributeLocationsInheritance
object ← VertexAttributeLocations
Methods
Allocate(IEnumerable<string>, IReadOnlyDictionary<string, int>?)
Gives every attribute of one piece of geometry its location. A mesh attribute keeps its canonical slot. Any other name takes the lowest slot this set leaves free, in name order, so that the shader and the vertex struct declaring the same set both arrive at the same numbers.
A name in pinned keeps the location it was given, and the rest allocate around it. That is how a shader that places an attribute itself, with an explicit layout qualifier, stays consistent with the geometry that feeds it.
public static FrozenDictionary<string, int> Allocate(IEnumerable<string> attributeNames, IReadOnlyDictionary<string, int>? pinned = null)Parameters
attributeNames IEnumerable<string>
pinned IReadOnlyDictionary<string, int>?
Returns
Get(string)
Resolves a shader input name, or -1 if unknown.
public static int Get(string attributeName)Parameters
attributeName string
Returns
Get(string, int)
Resolves a buffer semantic, or -1 if unknown. The fallback when no signature name does.
public static int Get(string semanticName, int semanticIndex)Parameters
semanticName string
semanticIndex int
Returns
GetName(VertexSlot)
The name of a mesh attribute, as its shaders declare it.
public static string GetName(VertexSlot slot)Parameters
slot VertexSlot
Returns
GetSemantic(int)
The buffer semantic a slot is filled from, for describing handbuilt geometry as a layout.
public static (string Name, int Index) GetSemantic(int slot)Parameters
slot int
Returns
Resolve(VsInputSignature, RenderInputLayoutField, out string)
Resolves one buffer attribute, or -1 if unknown. The input signature name wins over the attribute's own semantic.
public static int Resolve(Material.VsInputSignature inputSignature, VBIB.RenderInputLayoutField attribute, out string signatureName)Parameters
inputSignature Material.VsInputSignature
attribute VBIB.RenderInputLayoutField
signatureName string

