Class GlobalParamsRegistry
java.lang.Object
dev.engine.graphics.shader.GlobalParamsRegistry
Registry of global shader parameter blocks.
Each entry maps a name (e.g., "Engine", "Camera", "Light") to a Java record type and a fixed binding index. The registry generates Slang code for all registered blocks and holds per-frame data for upload.
Engine registers defaults; users add their own without modifying engine code:
registry.register("Light", LightParams.class, 2);
registry.update("Light", new LightParams(dir, color, 1.0f));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA registered global param block. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns all registered entries in registration order.Generates the combined Slang source for all registered global param blocks.generateSlang(boolean includeGlobals) Generates the combined Slang source for all registered global param blocks.intReturns the next available binding index (one past the highest registered).voidRegisters a global param block.String[]Returns the concrete UBO type names for all registered blocks, in registration order.voidUpdates the per-frame data for a registered param block.
-
Constructor Details
-
GlobalParamsRegistry
public GlobalParamsRegistry()
-
-
Method Details
-
register
-
update
-
entries
Returns all registered entries in registration order. -
generateSlang
Generates the combined Slang source for all registered global param blocks. Each block gets interface + struct + cbuffer (with register) + impl + static global. -
generateSlang
Generates the combined Slang source for all registered global param blocks.- Parameters:
includeGlobals- if true, emits static global instances (for process compiler fallback). If false, omits globals — shader uses generic specialization instead.
-
specializationArgs
Returns the concrete UBO type names for all registered blocks, in registration order. Used as specialization arguments when compiling with the native Slang compiler. E.g., ["UboEngineParams", "UboCameraParams", "UboObjectParams"] -
nextBinding
public int nextBinding()Returns the next available binding index (one past the highest registered).
-