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

Byte code cache interface. More...

#include <BytecodeCache.h>

Inheritance diagram for Diligent::IBytecodeCache:
Diligent.IObject

Public Member Functions

virtual bool DILIGENT_CALL_TYPE Load (IDataBlob *pData)=0
 Loads the cache data from the binary blob.
 
virtual void DILIGENT_CALL_TYPE GetBytecode (const ShaderCreateInfo &ShaderCI, IDataBlob **ppByteCode)=0
 Returns the byte code for the requested shader create parameters.
 
virtual void DILIGENT_CALL_TYPE AddBytecode (const ShaderCreateInfo &ShaderCI, IDataBlob *pByteCode)=0
 Adds the byte code to the cache.
 
virtual void DILIGENT_CALL_TYPE RemoveBytecode (const ShaderCreateInfo &ShaderCI)=0
 Removes the byte code from the cache.
 
virtual void DILIGENT_CALL_TYPE Store (IDataBlob **ppDataBlob)=0
 Writes the cache data to the binary data blob.
 
virtual void DILIGENT_CALL_TYPE Clear ()=0
 Clears the cache and resets it to default state.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
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

Byte code cache interface.

Member Function Documentation

◆ AddBytecode()

virtual void DILIGENT_CALL_TYPE Diligent::IBytecodeCache::AddBytecode ( const ShaderCreateInfo & ShaderCI,
IDataBlob * pByteCode )
pure virtual

Adds the byte code to the cache.

Parameters
[in]ShaderCI- Shader create parameters for the byte code to add.
[in]pByteCode- A pointer to the byte code to add to the cache.
Remarks
If the byte code for the given shader create parameters is already present in the cache, it is replaced.

◆ GetBytecode()

virtual void DILIGENT_CALL_TYPE Diligent::IBytecodeCache::GetBytecode ( const ShaderCreateInfo & ShaderCI,
IDataBlob ** ppByteCode )
pure virtual

Returns the byte code for the requested shader create parameters.

Parameters
[in]ShaderCI- Shader create info to find the byte code for.
[out]ppByteCode- Address of the memory location where a pointer to the data blob containing the byte code will be written. The function calls AddRef(), so that the new object will have one reference.

◆ Load()

virtual bool DILIGENT_CALL_TYPE Diligent::IBytecodeCache::Load ( IDataBlob * pData)
pure virtual

Loads the cache data from the binary blob.

Parameters
[in]pData- A pointer to the cache data.
Returns
true if the data was loaded successfully, and false otherwise.

◆ RemoveBytecode()

virtual void DILIGENT_CALL_TYPE Diligent::IBytecodeCache::RemoveBytecode ( const ShaderCreateInfo & ShaderCI)
pure virtual

Removes the byte code from the cache.

Parameters
[in]ShaderCI- Shader create information for the byte code to remove.

◆ Store()

virtual void DILIGENT_CALL_TYPE Diligent::IBytecodeCache::Store ( IDataBlob ** ppDataBlob)
pure virtual

Writes the cache data to the binary data blob.

Parameters
[out]ppDataBlob- Address of the memory location where a pointer to the data blob containing the cache data will be written. The function calls AddRef(), so that the new object will have one reference.
Remarks
The data produced by this method is intended to be used by the Load method.