class
Variation
Variation is a set of shading passes bindable to the GPU pipeline.
Each shader has at least one variation, but many have multiple. Each variation is typically compiled with different set of preprocessor defines enabling or disabling specific features of the shader. A shader may also have multiple variations for different rendering backends (e.g. DirectX, OpenGL, Vulkan, etc.).
Public
Constructors
Variation
Methods
staticCreate
Creates a new variation.
- owner
- Shader that owns the variation.
- language
- Shading language used by the variation. The engine will not use this variation unless this language is supported by the render backend.
- variationParameters
- Variation parameters used for compiling this variation.
- precompiledData
- Optional set of precompiled variation data. If not provided, you must manually call Compile() on the variation before use.
Returns: Newly creted variation.
staticGetRttiStatic
~TVariation<IsRenderProxy>
GetPass
Returns a pass with the specified index.
GetPassCount
Returns total number of passes.
Compile
Compiles the variation in case it was not initialized with precompiled data.
IsCompiled
Returns true if the variation has been fully compiled.
Internal
Methods
SetCompiledPassData
Assigns a set of compiled passes to the variation.
This should be called only when a variation has not been initialized with precompiled pass data, and compilation for the variation finished.
SetOwner
Sets the shader that owns this variation.
Protected
Methods
CreateRenderProxy
Creates an object that contains render thread specific data and methods for this object.
Can be null if such object is not required.
GetCoreDependencies
Populates the provided array with all core objects that this core object depends upon.
Dependencies are required for syncing to the render thread, so the system can be aware to update the dependant objects if a dependency is marked as dirty (for example updating a camera's viewport should also trigger an update on camera so it has a chance to potentially update its data).
MarkRenderProxyDirty
Marks the contents as dirty, causing it to sync with the render thread object.
CreateRenderProxySyncPacket
Creates a data packet that will be used for syncing the core object with it's render proxy.
Caller must free the retrieved packet using the provided allocator when done using it.
SyncToRenderProxy
Ensures all dirty syncable data is send to the render proxy (if any).
GetSelf
Returns a reference to itself using the most derived type.
staticCreateEmpty
Creates a new variation but doesn't initialize it.
Fields
mOwner
mPasses
mHasPassData
mIsCompiled
Private
Constructors
Variation
Serialization only constructor.