Interface ShaderPreProcessor

All Known Implementing Classes:
DynamicBufferProcessor, ShaderBindingProcessor, ShaderBufferProcessor, ShaderImportProcessor, ShaderModifyProcessor, ShaderMultiProcessor, ShaderVersionProcessor, SodiumShaderPreProcessor

public interface ShaderPreProcessor
Modifies the source code of a shader before compilation.
  • Field Details

  • Method Details

    • prepare

      default void prepare()
      Called once when a shader is first run through the pre-processor.
    • modify

      Modifies the specified shader source input.
      Parameters:
      ctx - Context for modifying shaders
      tree - The GLSL source code tree to modify
      Throws:
      IOException - If any error occurs while editing the source
      GlslSyntaxException - If there was an error in the syntax of the source code
      LexerException - If an error occurs during shader C preprocessing
    • allOf

      static ShaderPreProcessor allOf(ShaderPreProcessor... processors)
      Creates a composite pre-processor with the specified values.
      Parameters:
      processors - The processors to run in order
      Returns:
      A new processor that runs all provided processors
    • allOf

      static ShaderPreProcessor allOf(Collection<ShaderPreProcessor> processors)
      Creates a composite pre-processor with the specified values.
      Parameters:
      processors - The processors to run in order
      Returns:
      A new processor that runs all provided processors