Class BinaryShaderObject

java.lang.Object
codechicken.lib.render.shader.NamedShaderObject
codechicken.lib.render.shader.BinaryShaderObject
All Implemented Interfaces:
ShaderObject, net.minecraft.server.packs.resources.PreparableReloadListener, net.minecraft.server.packs.resources.ResourceManagerReloadListener

public class BinaryShaderObject extends NamedShaderObject implements net.minecraft.server.packs.resources.ResourceManagerReloadListener
Allows using pre-compiled shader binaries with ShaderProgram.

Created by KitsuneAlex on 18/11/21.

  • Constructor Details

  • Method Details

    • isDirty

      public boolean isDirty()
      Description copied from interface: ShaderObject
      Checks if this shader is dirty and requires re-compiling.
      Specified by:
      isDirty in interface ShaderObject
      Returns:
      If this shader is dirty.
    • alloc

      public void alloc()
      Description copied from interface: ShaderObject
      Allocates and compiles this ShaderObject. Does nothing if the shader is already compiled.
      Specified by:
      alloc in interface ShaderObject
    • getShaderID

      public int getShaderID()
      Description copied from interface: ShaderObject
      Gets the GL id for this ShaderObject.
      Specified by:
      getShaderID in interface ShaderObject
      Returns:
      The id, -1 of not allocated.
    • onLink

      public void onLink(int programId)
      Description copied from interface: ShaderObject
      Called when this ShaderObject is linked to a ShaderProgram.
      Specified by:
      onLink in interface ShaderObject
      Parameters:
      programId - The GL id of the program.
    • onResourceManagerReload

      public void onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager resourceManager)
      Specified by:
      onResourceManagerReload in interface net.minecraft.server.packs.resources.ResourceManagerReloadListener