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 code
fields - Each field and how to serialize it from the java type
requestedBinding - The user requested binding to use. This will only be respected if the requested buffer type is supported on the hardware
memoryLayout - The memory layout OpenGL should use
structSpecifier - 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.
  • Constructor Details

  • 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 attempted
      interfaceName - The namespace of the shader block in the shader
      Returns:
      A node for
    • binding

      public ShaderBlock.BufferBinding binding()
      Returns:
      The actual binding this block uses
    • builder

      public static <T> VeilShaderBufferLayout.Builder<T> 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • fields

      Returns the value of the fields record component.
      Returns:
      the value of the fields record component
    • requestedBinding

      public ShaderBlock.BufferBinding requestedBinding()
      Returns the value of the requestedBinding record component.
      Returns:
      the value of the requestedBinding record component
    • memoryLayout

      public ShaderBlock.MemoryLayout memoryLayout()
      Returns the value of the memoryLayout record component.
      Returns:
      the value of the memoryLayout record component
    • structSpecifier

      public GlslStructSpecifier structSpecifier()
      Returns the value of the structSpecifier record component.
      Returns:
      the value of the structSpecifier record component