Interface ShaderCompiler
- All Known Implementing Classes:
NoOpShaderCompiler
public interface ShaderCompiler
Compiles shader source code to target-specific output (GLSL, SPIRV, WGSL).
Desktop: wraps SlangCompilerNative (FFM). Web: wraps Slang WASM compiler.
Implementations are injected into ShaderManager and Renderer
so the same rendering pipeline works on all platforms.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCompiled shader result with code per entry point and optional binding metadata.static final recordDescribes an entry point to compile.static enumBroad categories for shader parameters.static final recordDiscovered shader parameter with name, binding slot, and category. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptioncompile(String source, List<ShaderCompiler.EntryPointDesc> entryPoints, int target) Compiles shader source with multiple entry points.compileWithTypeMap(String source, List<ShaderCompiler.EntryPointDesc> entryPoints, int target, Map<String, String> typeMap) Compiles with generic type specialization (material variants).booleanWhether the compiler is available and ready for use.
-
Field Details
-
STAGE_VERTEX
static final int STAGE_VERTEX- See Also:
-
STAGE_FRAGMENT
static final int STAGE_FRAGMENT- See Also:
-
STAGE_COMPUTE
static final int STAGE_COMPUTE- See Also:
-
TARGET_GLSL
static final int TARGET_GLSL- See Also:
-
TARGET_SPIRV
static final int TARGET_SPIRV- See Also:
-
TARGET_WGSL
static final int TARGET_WGSL- See Also:
-
-
Method Details
-
isAvailable
boolean isAvailable()Whether the compiler is available and ready for use. -
compile
ShaderCompiler.CompileResult compile(String source, List<ShaderCompiler.EntryPointDesc> entryPoints, int target) Compiles shader source with multiple entry points. -
compileWithTypeMap
ShaderCompiler.CompileResult compileWithTypeMap(String source, List<ShaderCompiler.EntryPointDesc> entryPoints, int target, Map<String, String> typeMap) Compiles with generic type specialization (material variants).
-