Class SlangMaterialGenerator
java.lang.Object
dev.engine.graphics.shader.SlangMaterialGenerator
Generates Slang interface + implementation for material parameters.
The shader always accesses data through IMaterialParams.
The implementation (UBO, SSBO array, bindless) is generated based on
the upload strategy and injected before compilation.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringgenerate(Set<? extends PropertyKey<?, ?>> keys, SlangMaterialGenerator.UploadMode mode) Generates the full material injection block (interface + chosen implementation).static StringgenerateInterface(Set<? extends PropertyKey<?, ?>> keys) Generates the Slang interface for material parameter access.static StringgenerateSsboImplementation(Set<? extends PropertyKey<?, ?>> keys) Generates an SSBO-backed implementation for instanced rendering.static StringgenerateUboImplementation(Set<? extends PropertyKey<?, ?>> keys) Generates a UBO-backed implementation of IMaterialParams.
-
Method Details
-
generateInterface
Generates the Slang interface for material parameter access. Each scalar/vector parameter becomes a getter method. Textures are excluded from the interface — they're bound separately. -
generateUboImplementation
Generates a UBO-backed implementation of IMaterialParams. Each parameter is a field in a cbuffer, accessor returns the field. -
generateSsboImplementation
Generates an SSBO-backed implementation for instanced rendering. All instance data in a StructuredBuffer, indexed by instance ID. -
generate
public static String generate(Set<? extends PropertyKey<?, ?>> keys, SlangMaterialGenerator.UploadMode mode) Generates the full material injection block (interface + chosen implementation).
-