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, io.github.ocelot.glslprocessor.api.grammar.GlslStructSpecifier structSpecifier)
extends Record
Defines the full layout of a shader block.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCreates a new layout for a shader block.static interfaceSerializes a single field to the internal buffer. -
Constructor Summary
ConstructorsConstructorDescriptionVeilShaderBufferLayout(String name, Map<String, VeilShaderBufferLayout.FieldSerializer<T>> fields, ShaderBlock.BufferBinding requestedBinding, ShaderBlock.MemoryLayout memoryLayout, io.github.ocelot.glslprocessor.api.grammar.GlslStructSpecifier structSpecifier) Creates an instance of aVeilShaderBufferLayoutrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbinding()static <T> VeilShaderBufferLayout.Builder<T> builder()Creates a new shader buffer builder.io.github.ocelot.glslprocessor.api.node.GlslNodecreateNode(boolean shaderStorageSupported, @Nullable String interfaceName) Creates a GLSL node representation of this layout.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thememoryLayoutrecord component.name()Returns the value of thenamerecord component.Returns the value of therequestedBindingrecord component.io.github.ocelot.glslprocessor.api.grammar.GlslStructSpecifierReturns the value of thestructSpecifierrecord component.final StringtoString()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, io.github.ocelot.glslprocessor.api.grammar.GlslStructSpecifier structSpecifier) Creates an instance of aVeilShaderBufferLayoutrecord class.- Parameters:
name- the value for thenamerecord componentfields- the value for thefieldsrecord componentrequestedBinding- the value for therequestedBindingrecord componentmemoryLayout- the value for thememoryLayoutrecord componentstructSpecifier- the value for thestructSpecifierrecord component
-
-
Method Details
-
createNode
public io.github.ocelot.glslprocessor.api.node.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 declaring a shader buffer struct
-
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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
requestedBinding
Returns the value of therequestedBindingrecord component.- Returns:
- the value of the
requestedBindingrecord component
-
memoryLayout
Returns the value of thememoryLayoutrecord component.- Returns:
- the value of the
memoryLayoutrecord component
-
structSpecifier
public io.github.ocelot.glslprocessor.api.grammar.GlslStructSpecifier structSpecifier()Returns the value of thestructSpecifierrecord component.- Returns:
- the value of the
structSpecifierrecord component
-