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.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Context for modifying source code and shader behavior.static enum
Specifies how includes should interact with existing functions and fields in shader sources.static interface
Context for modifying source code and shader behavior.static interface
Context for modifying source code and sodium shader behavior.static interface
Context for modifying source code and shader behavior. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShaderPreProcessor
allOf
(ShaderPreProcessor... processors) Creates a composite pre-processor with the specified values.static ShaderPreProcessor
allOf
(Collection<ShaderPreProcessor> processors) Creates a composite pre-processor with the specified values.void
modify
(ShaderPreProcessor.Context ctx, GlslTree tree) Modifies the specified shader source input.default void
prepare()
Called once when a shader is first run through the pre-processor.
-
Field Details
-
NOOP
-
-
Method Details
-
prepare
default void prepare()Called once when a shader is first run through the pre-processor. -
modify
void modify(ShaderPreProcessor.Context ctx, GlslTree tree) throws IOException, GlslSyntaxException, LexerException Modifies the specified shader source input.- Parameters:
ctx
- Context for modifying shaderstree
- The GLSL source code tree to modify- Throws:
IOException
- If any error occurs while editing the sourceGlslSyntaxException
- If there was an error in the syntax of the source codeLexerException
- If an error occurs during shader C preprocessing
-
allOf
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
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
-