Record Class IntermediaryShaderModule

java.lang.Object
java.lang.Record
com.mojang.blaze3d.vulkan.glsl.IntermediaryShaderModule
All Implemented Interfaces:
AutoCloseable

public record IntermediaryShaderModule(String name, @Nullable ByteBuffer spirv, List<SpvUniformBuffer> uniformBuffers, List<SpvSampler> samplers, List<SpvVariable> outputs, List<SpvVariable> inputs) extends Record implements AutoCloseable
  • Field Details

    • name

      private final String name
      The field for the name record component.
    • spirv

      private final @Nullable ByteBuffer spirv
      The field for the spirv record component.
    • uniformBuffers

      private final List<SpvUniformBuffer> uniformBuffers
      The field for the uniformBuffers record component.
    • samplers

      private final List<SpvSampler> samplers
      The field for the samplers record component.
    • outputs

      private final List<SpvVariable> outputs
      The field for the outputs record component.
    • inputs

      private final List<SpvVariable> inputs
      The field for the inputs record component.
    • INVALID

      public static final IntermediaryShaderModule INVALID
  • Constructor Details

    • IntermediaryShaderModule

      public IntermediaryShaderModule(String name, @Nullable ByteBuffer spirv, List<SpvUniformBuffer> uniformBuffers, List<SpvSampler> samplers, List<SpvVariable> outputs, List<SpvVariable> inputs)
      Creates an instance of a IntermediaryShaderModule record class.
      Parameters:
      name - the value for the name record component
      spirv - the value for the spirv record component
      uniformBuffers - the value for the uniformBuffers record component
      samplers - the value for the samplers record component
      outputs - the value for the outputs record component
      inputs - the value for the inputs record component
  • Method Details

    • createFromSpirv

      public static IntermediaryShaderModule createFromSpirv(String filename, ByteBuffer spirv) throws ShaderCompileException
      Throws:
      ShaderCompileException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • rebind

      public void rebind(List<String> inputVariables, List<VulkanBindGroupLayout.Entry> entries) throws ShaderCompileException
      Throws:
      ShaderCompileException
    • createVulkanShaderModule

      public long createVulkanShaderModule(VulkanDevice device)
    • getUniformBuffer

      private @Nullable SpvUniformBuffer getUniformBuffer(String name)
    • getSampler

      private @Nullable SpvSampler getSampler(String name)
    • getInputVariable

      private @Nullable SpvVariable getInputVariable(String name)
    • throwIfError

      private static void throwIfError(int result, String message) throws ShaderCompileException
      Throws:
      ShaderCompileException
    • getDecorationOffset

      private static int getDecorationOffset(long compiler, org.lwjgl.util.spvc.SpvcReflectedResource resource, int decoration, IntBuffer returnBuffer) throws ShaderCompileException
      Throws:
      ShaderCompileException
    • 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
    • spirv

      public @Nullable ByteBuffer spirv()
      Returns the value of the spirv record component.
      Returns:
      the value of the spirv record component
    • uniformBuffers

      public List<SpvUniformBuffer> uniformBuffers()
      Returns the value of the uniformBuffers record component.
      Returns:
      the value of the uniformBuffers record component
    • samplers

      public List<SpvSampler> samplers()
      Returns the value of the samplers record component.
      Returns:
      the value of the samplers record component
    • outputs

      public List<SpvVariable> outputs()
      Returns the value of the outputs record component.
      Returns:
      the value of the outputs record component
    • inputs

      public List<SpvVariable> inputs()
      Returns the value of the inputs record component.
      Returns:
      the value of the inputs record component