Class DynamicShaderBlockImpl<T>

java.lang.Object
foundry.veil.impl.client.render.shader.definition.ShaderBlockImpl<T>
foundry.veil.impl.client.render.shader.definition.DynamicShaderBlockImpl<T>
Type Parameters:
T - The type of object to serialize
All Implemented Interfaces:
DynamicShaderBlock<T>, ShaderBlock<T>, AutoCloseable, org.lwjgl.system.NativeResource

@Internal public class DynamicShaderBlockImpl<T> extends ShaderBlockImpl<T> implements DynamicShaderBlock<T>
Dynamic-size implementation of ShaderBlock.
  • Field Details

  • Constructor Details

    • DynamicShaderBlockImpl

      public DynamicShaderBlockImpl(int binding, long size, @NotNull @NotNull BiConsumer<T,ByteBuffer> serializer)
      Creates a new shader block of specified initial size.
      Parameters:
      size - The initial size of the shader buffer
      serializer - The serializer of values
  • Method Details

    • setSize

      public void setSize(long size)
      Description copied from interface: DynamicShaderBlock
      Resizes this shader block to match the new size.
      Specified by:
      setSize in interface DynamicShaderBlock<T>
      Parameters:
      size - The size in bytes
    • bind

      public void bind(int index)
      Description copied from class: ShaderBlockImpl
      Binds this block to the specified index.
      Specified by:
      bind in class ShaderBlockImpl<T>
      Parameters:
      index - The index to bind this block to
    • unbind

      public void unbind(int index)
      Description copied from class: ShaderBlockImpl
      Unbinds this block from the specified index.
      Specified by:
      unbind in class ShaderBlockImpl<T>
      Parameters:
      index - The index to unbind this block from