Package icyllis.arc3d.engine
Class VertexInputLayout.Attribute
java.lang.Object
icyllis.arc3d.engine.VertexInputLayout.Attribute
- Enclosing class:
VertexInputLayout
Describes a vertex or instance attribute.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMakes an attribute whose offset will be implicitly determined by the types and ordering of an array attributes.Makes an attribute with an explicit offset. -
Method Summary
Modifier and TypeMethodDescriptionstatic intalignOffset(int offset) It must be N-aligned for all types, where N is sizeof(float).final @NonNull ShaderVarfinal bytedstType()final intfinal Stringname()final intoffset()Returns the offset if attributes were specified with explicit offsets.final intsize()final bytesrcType()final intstride()
-
Field Details
-
OFFSET_ALIGNMENT
public static final int OFFSET_ALIGNMENT- See Also:
-
-
Constructor Details
-
Attribute
Makes an attribute whose offset will be implicitly determined by the types and ordering of an array attributes.- Parameters:
name- the attrib name, cannot be null or emptysrcType- the data type in vertex buffer, seeEngine.VertexAttribTypedstType- the data type in vertex shader, seeSLDataType
-
Attribute
Makes an attribute with an explicit offset.- Parameters:
name- the attrib name, UpperCamelCase, cannot be null or emptysrcType- the data type in vertex buffer, seeEngine.VertexAttribTypedstType- the data type in vertex shader, seeSLDataTypeoffset- N-aligned offset
-
-
Method Details
-
alignOffset
public static int alignOffset(int offset) It must be N-aligned for all types, where N is sizeof(float). -
name
-
srcType
public final byte srcType()- Returns:
- the data type in vertex buffer, see
Engine.VertexAttribType
-
dstType
public final byte dstType()- Returns:
- the data type in vertex shader, see
SLDataType
-
offset
public final int offset()Returns the offset if attributes were specified with explicit offsets. Otherwise, offsets (and total vertex stride) are implicitly determined from attribute order and types. SeeIMPLICIT_OFFSET. -
size
public final int size()- Returns:
- the size of the source data in bytes
-
locations
public final int locations()- Returns:
- the number of locations
-
stride
public final int stride()- Returns:
- the total size for this attribute in bytes
-
asShaderVar
-