Diligent Engine
Loading...
Searching...
No Matches
Diligent::IRadientMaterialWriter Struct Referenceabstract

#include <RadientMaterials.h>

Inheritance diagram for Diligent::IRadientMaterialWriter:
Diligent.IObject Diligent::IRadientSurfaceMaterialWriter

Public Member Functions

virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetParameter (RadientMaterialParameterHandle Handle, const void *pData, Uint32 DataSize)=0
template<typename ValueType>
RADIENT_STATUS SetParameter (RadientMaterialParameterHandle Handle, const ValueType &Value)
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetTexture (RadientMaterialParameterHandle Handle, Uint32 ArrayIndex, IRadientTextureAsset *pTexture)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE Commit ()=0
Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type>
void QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface)
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0

Detailed Description

Reusable material initialization writer.

A writer records every value explicitly assigned through its setter methods. Commit() publishes complete non-texture parameters, individual texture array elements, and any specialized material properties exposed by a derived writer. If multiple writers modify the same value, the last commit replaces that complete value. Commits must complete before the asset's load status, GPU resource status, or render view is first queried. The writer and its material asset are not thread-safe and must not be accessed concurrently with Commit().

Member Function Documentation

◆ Commit()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientMaterialWriter::Commit ( )
pure virtual

Applies the writer's pending changes to its material asset as one logical update. This is the authoritative check for whether the assignments change the material state. The writer remains valid after the call. On success or RADIENT_STATUS_NO_CHANGE, pending changes are cleared. On failure, pending changes are retained so the operation can be retried.

◆ SetParameter() [1/2]

template<typename ValueType>
RADIENT_STATUS Diligent::IRadientMaterialWriter::SetParameter ( RadientMaterialParameterHandle Handle,
const ValueType & Value )
inline

Replaces the complete value or value array identified by Handle, inferring the native data size from Value.

◆ SetParameter() [2/2]

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientMaterialWriter::SetParameter ( RadientMaterialParameterHandle Handle,
const void * pData,
Uint32 DataSize )
pure virtual

Replaces the complete value or value array identified by Handle. pData is copied immediately and DataSize must exactly match the parameter's native data size. Texture parameters are not accepted. The first assignment is always recorded, even if the material currently contains the supplied value. Returns RADIENT_STATUS_NO_CHANGE only if this writer already has an identical pending assignment.

◆ SetTexture()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientMaterialWriter::SetTexture ( RadientMaterialParameterHandle Handle,
Uint32 ArrayIndex,
IRadientTextureAsset * pTexture )
pure virtual

Replaces one texture array element identified by Handle and ArrayIndex. Commit() publishes only modified texture elements, so independent element updates from different writers are preserved. The writer retains pTexture; null is a valid texture value. Non-texture parameters are not accepted. The first assignment is always recorded, even if the material currently contains pTexture. Returns RADIENT_STATUS_NO_CHANGE only if this writer already has an identical pending assignment.