class
MaterialParameterAdapter
Inherits:
TMaterialParameterAdapter<false>
Used for transferring material parameters to GpuParameterSet.
Public
Constructors
MaterialParameterAdapter
MaterialParameterAdapter() = default
MaterialParameterAdapter
MaterialParameterAdapter(const SPtr<Variation> &variation, const HShader &shader, const SPtr<MaterialParameters> ¶ms)
Methods
~TMaterialParameterAdapter<IsRenderProxy>
~TMaterialParameterAdapter<IsRenderProxy>()
GetGpuParameterSet
SPtr<GpuParametersType> GetGpuParameterSet(u32 passIndex = 0, u32 setIndex = 0)
Returns a set of GPU parameters for the specified pass and descriptor set.
- passIndex
- Pass in which to look the GPU program for in.
- setIndex
- Descriptor set index to retrieve parameters for.
Returns: GPU parameters object that can be used for setting parameters of all GPU programs in a pass. Returns null if pass or set doesn't exist.
GetUniformBufferIndex
u32 GetUniformBufferIndex(const String &name) const
Searches for a parameter uniform buffer with the specified name, and returns an index you can use for accessing it.
Returns ~0u if buffer was not found.
SetUniformBuffer
void SetUniformBuffer(u32 index, const UniformBufferPointerType &buffer, bool ignoreInUpdate = false)
Assign a uniform buffer with the specified index to all the relevant child GpuParameterSet objects.
- index
- Index of the buffer, as retrieved from GetUniformBufferIndex().
- buffer
- Uniform buffer to assign.
- ignoreInUpdate
- If true the buffer will not be updated during the Update() call. This is useful if the caller wishes to manually update the buffer contents externally, to prevent overwriting manually written data during update.
GetPassCount
u32 GetPassCount() const
Returns the number of passes the set contains the parameters for.
GetSetCount
u32 GetSetCount(u32 passIndex)
Returns the number of sets in the specified pass.
Update
void Update(const MaterialType &material, float t = 0.F, bool updateAll = false)
Updates parameter data in underlying GpuParameter objects from the provided material parameters object.
- material
- Material containing parameters to update from. This object must have been created from the same material (or the same shader/variation combination).
- t
- Time to evaluate animated parameters at (if any).
- updateAll
- Normally the system will track dirty parameters since the last call to this method, and only update the dirty ones. Set this to true if you want to force all parameters to update, regardless of their dirty state.
Protected
Fields
mGpuParametersPerPass
Vector<TInlineArray<SPtr<GpuParametersType>, 4>> mGpuParametersPerPass
mUniformBuffers
Vector<UniformBufferInfo> mUniformBuffers
mDataParamInfos
Vector<DataParamInfo> mDataParamInfos
mPassParamInfos
PassParamInfo * mPassParamInfos
mParamVersion
u64 mParamVersion
mData
u8 * mData