Record Class CompiledShader

java.lang.Object
java.lang.Record
foundry.veil.api.client.render.shader.CompiledShader
Record Components:
sourceFile - The source file this shader was compiled from or null if the shader has no file
id - The OpenGL id of the shader
uniformBindings - The bindings set by the shader
definitionDependencies - The shader pre-definitions this shader is dependent on
includes - All shader imports included in this file
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource

public record CompiledShader(@Nullable net.minecraft.resources.ResourceLocation sourceFile, int id, it.unimi.dsi.fastutil.objects.Object2IntMap<String> uniformBindings, Set<String> definitionDependencies, Set<net.minecraft.resources.ResourceLocation> includes) extends Record implements org.lwjgl.system.NativeResource
A shader instance that has additional pre-compiled data. apply(ShaderProgram) should be called after this shader is attached to a program.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompiledShader(@Nullable net.minecraft.resources.ResourceLocation sourceFile, int id, it.unimi.dsi.fastutil.objects.Object2IntMap<String> uniformBindings, Set<String> definitionDependencies, Set<net.minecraft.resources.ResourceLocation> includes)
    Creates an instance of a CompiledShader record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Applies the additional attributes of this shader to the specified program.
    Returns the value of the definitionDependencies record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
     
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    Set<net.minecraft.resources.ResourceLocation>
    Returns the value of the includes record component.
    @Nullable net.minecraft.resources.ResourceLocation
    Returns the value of the sourceFile record component.
    final String
    Returns a string representation of this record class.
    it.unimi.dsi.fastutil.objects.Object2IntMap<String>
    Returns the value of the uniformBindings record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close
  • Constructor Details

    • CompiledShader

      public CompiledShader(@Nullable @Nullable net.minecraft.resources.ResourceLocation sourceFile, int id, it.unimi.dsi.fastutil.objects.Object2IntMap<String> uniformBindings, Set<String> definitionDependencies, Set<net.minecraft.resources.ResourceLocation> includes)
      Creates an instance of a CompiledShader record class.
      Parameters:
      sourceFile - the value for the sourceFile record component
      id - the value for the id record component
      uniformBindings - the value for the uniformBindings record component
      definitionDependencies - the value for the definitionDependencies record component
      includes - the value for the includes record component
  • Method Details

    • apply

      public void apply(ShaderProgram program)
      Applies the additional attributes of this shader to the specified program.
    • free

      public void free()
      Specified by:
      free in interface org.lwjgl.system.NativeResource
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • sourceFile

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • uniformBindings

      public it.unimi.dsi.fastutil.objects.Object2IntMap<String> uniformBindings()
      Returns the value of the uniformBindings record component.
      Returns:
      the value of the uniformBindings record component
    • definitionDependencies

      public Set<String> definitionDependencies()
      Returns the value of the definitionDependencies record component.
      Returns:
      the value of the definitionDependencies record component
    • includes

      public Set<net.minecraft.resources.ResourceLocation> includes()
      Returns the value of the includes record component.
      Returns:
      the value of the includes record component