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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
alignOffset
(int offset) It must be N-aligned for all types, where N is sizeof(float).final ShaderVar
final byte
dstType()
final int
final String
name()
final int
offset()
Returns the offset if attributes were specified with explicit offsets.final int
size()
final byte
srcType()
final int
stride()
-
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.VertexAttribType
dstType
- 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.VertexAttribType
dstType
- the data type in vertex shader, seeSLDataType
offset
- 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
-