Package icyllis.arc3d.compiler
Enum Class MemoryLayout
- All Implemented Interfaces:
Serializable
,Comparable<MemoryLayout>
,Constable
Standard layout for interface blocks, according to OpenGL and Vulkan specification.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the alignment in bytes.int
Returns the alignment in bytes, also computes the size and stride simultaneously.boolean
isSupported
(Type type) Returns true if the type is host shareable, i.e., a composite type.int
Returns the total size in bytes, including padding at the end.int
Returns the minimum stride forSpvDecorationArrayStride
andSpvDecorationMatrixStride
.static MemoryLayout
Returns the enum constant of this class with the specified name.static MemoryLayout[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Std140
OpenGL standard layout, for uniform blocks. (GLSL only, OpenGL only)The base alignment of an array, matrix, and structure needs to be a multiple of 16.
-
Extended
SPIR-V extended alignment, for uniform blocks. (WGSL or SPIR-V, WebGPU, OpenGL or Vulkan)Similar to std140, the base alignment of an array and structure needs to be a multiple of 16, but that of a matrix does not.
-
Std430
OpenGL standard layout, for push constants and shader storage blocks. Can be used on uniform blocks for Vulkan, if supported. (GLSL, WGSL or SPIR-V, OpenGL, WebGPU or Vulkan) -
Scalar
Scalar alignment, may be slower than std430, for Vulkan if supported.Test only. We're unsure about if we can use the padding between the end of a structure or an array and the next multiple of alignment of that structure or array. glslang doesn't use it, but Vulkan spec allows it.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
alignment
Returns the alignment in bytes. -
alignment
Returns the alignment in bytes, also computes the size and stride simultaneously. out[0] holdssize(icyllis.arc3d.compiler.tree.Type)
, out[1] holds matrix stride, out[2] holds array stride. Matrix stride is non-zero only when the type is matrix or array-of-matrices. Array stride is non-zero only when the type is array.- Parameters:
out
- size, matrix stride, array stride, respectively, can be null- Returns:
- base alignment
-
stride
Returns the minimum stride forSpvDecorationArrayStride
andSpvDecorationMatrixStride
. -
size
Returns the total size in bytes, including padding at the end. -
isSupported
Returns true if the type is host shareable, i.e., a composite type. Boolean type is not supported, use uint32 instead.
-