Package foundry.veil.api.client.render
Record Class VeilShaderBufferLayout<T>
java.lang.Object
java.lang.Record
foundry.veil.api.client.render.VeilShaderBufferLayout<T>
- Type Parameters:
T
- The type of data the shader block will serialize- Record Components:
name
- The name of the block. This is the name of the block referenced in the codefields
- Each field and how to serialize it from the java typerequestedBinding
- The user requested binding to use. This will only be respected if the requested buffer type is supported on the hardwarememoryLayout
- The memory layout OpenGL should usestructSpecifier
- The specified for the struct data in the layout
public record VeilShaderBufferLayout<T>(String name, Map<String,VeilShaderBufferLayout.FieldSerializer<T>> fields, ShaderBlock.BufferBinding requestedBinding, ShaderBlock.MemoryLayout memoryLayout, GlslStructSpecifier structSpecifier)
extends Record
Defines the full layout of a shader block.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Creates a new layout for a shader block.static interface
Serializes a single field to the internal buffer. -
Constructor Summary
ConstructorDescriptionVeilShaderBufferLayout
(String name, Map<String, VeilShaderBufferLayout.FieldSerializer<T>> fields, ShaderBlock.BufferBinding requestedBinding, ShaderBlock.MemoryLayout memoryLayout, GlslStructSpecifier structSpecifier) Creates an instance of aVeilShaderBufferLayout
record class. -
Method Summary
Modifier and TypeMethodDescriptionbinding()
static <T> VeilShaderBufferLayout.Builder
<T> builder()
Creates a new shader buffer builder.createNode
(boolean shaderStorageSupported, @Nullable String interfaceName) Creates a GLSL node representation of this layout.final boolean
Indicates whether some other object is "equal to" this one.fields()
Returns the value of thefields
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thememoryLayout
record component.name()
Returns the value of thename
record component.Returns the value of therequestedBinding
record component.Returns the value of thestructSpecifier
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
VeilShaderBufferLayout
public VeilShaderBufferLayout(String name, Map<String, VeilShaderBufferLayout.FieldSerializer<T>> fields, ShaderBlock.BufferBinding requestedBinding, ShaderBlock.MemoryLayout memoryLayout, GlslStructSpecifier structSpecifier) Creates an instance of aVeilShaderBufferLayout
record class.- Parameters:
name
- the value for thename
record componentfields
- the value for thefields
record componentrequestedBinding
- the value for therequestedBinding
record componentmemoryLayout
- the value for thememoryLayout
record componentstructSpecifier
- the value for thestructSpecifier
record component
-
-
Method Details
-
createNode
public GlslNode createNode(boolean shaderStorageSupported, @Nullable @Nullable String interfaceName) Creates a GLSL node representation of this layout.- Parameters:
shaderStorageSupported
- Whether shader storage blocks are supported and can be attemptedinterfaceName
- The namespace of the shader block in the shader- Returns:
- A node for
-
binding
- Returns:
- The actual binding this block uses
-
builder
Creates a new shader buffer builder.- Type Parameters:
T
- The type of data the shader block will serialize- Returns:
- A new builder for creating a block
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
fields
Returns the value of thefields
record component.- Returns:
- the value of the
fields
record component
-
requestedBinding
Returns the value of therequestedBinding
record component.- Returns:
- the value of the
requestedBinding
record component
-
memoryLayout
Returns the value of thememoryLayout
record component.- Returns:
- the value of the
memoryLayout
record component
-
structSpecifier
Returns the value of thestructSpecifier
record component.- Returns:
- the value of the
structSpecifier
record component
-