Interface ShaderPreProcessor
- All Known Implementing Classes:
DynamicBufferProcessor,ShaderBindingProcessor,ShaderBufferProcessor,ShaderFeatureProcessor,ShaderImportProcessor,ShaderModifyProcessor,ShaderMultiProcessor,ShaderVersionProcessor,SodiumShaderPreProcessor
public interface ShaderPreProcessor
Modifies the source code of a shader before compilation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContext for modifying source code and shader behavior.static enumSpecifies how includes should interact with existing functions and fields in shader sources.static interfaceContext for modifying source code and shader behavior.static interfaceContext for modifying source code and sodium shader behavior.static interfaceContext for modifying source code and shader behavior. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ShaderPreProcessorallOf(ShaderPreProcessor... processors) Creates a composite pre-processor with the specified values.static ShaderPreProcessorallOf(Collection<ShaderPreProcessor> processors) Creates a composite pre-processor with the specified values.voidmodify(ShaderPreProcessor.Context ctx, io.github.ocelot.glslprocessor.api.node.GlslTree tree) Modifies the specified shader source input.default voidprepare()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, io.github.ocelot.glslprocessor.api.node.GlslTree tree) throws IOException, io.github.ocelot.glslprocessor.api.GlslSyntaxException, io.github.ocelot.glslprocessor.lib.anarres.cpp.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 sourceio.github.ocelot.glslprocessor.api.GlslSyntaxException- If there was an error in the syntax of the source codeio.github.ocelot.glslprocessor.lib.anarres.cpp.LexerException- 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
-