Diligent Engine
 
Loading...
Searching...
No Matches
Diligent.IShader Struct Referenceabstract

Shader interface. More...

#include <Shader.h>

Inheritance diagram for Diligent.IShader:
Diligent::IDeviceObject Diligent.IObject Diligent::ISerializedShader Diligent::IShaderD3D Diligent::IShaderGL Diligent::IShaderMtl Diligent::IShaderVk Diligent::IShaderWebGPU Diligent::IShaderD3D11 Diligent::IShaderD3D12

Public Member Functions

virtual const ShaderDesc &DILIGENT_CALL_TYPE GetDesc () const override=0
 Returns the shader description.
 
virtual Uint32 DILIGENT_CALL_TYPE GetResourceCount () const =0
 Returns the total number of shader resources.
 
virtual void DILIGENT_CALL_TYPE GetResourceDesc (Uint32 Index, ShaderResourceDesc &ResourceDesc) const =0
 Returns the pointer to the array of shader resources.
 
virtual const ShaderCodeBufferDesc *DILIGENT_CALL_TYPE GetConstantBufferDesc (Uint32 Index) const =0
 For a constant buffer resource, returns the buffer description. See Diligent::ShaderCodeBufferDesc.
 
virtual void DILIGENT_CALL_TYPE GetBytecode (const void **ppBytecode, Uint64 &Size) const =0
 Returns the shader bytecode.
 
virtual SHADER_STATUS DILIGENT_CALL_TYPE GetStatus (bool WaitForCompletion=false)=0
 Returns the shader status, see Diligent::SHADER_STATUS.
 
- Public Member Functions inherited from Diligent::IDeviceObject
virtual Int32 DILIGENT_CALL_TYPE GetUniqueID () const =0
 Returns unique identifier assigned to an object.
 
virtual void DILIGENT_CALL_TYPE SetUserData (IObject *pUserData)=0
 Stores a pointer to the user-provided data object.
 
virtual IObject *DILIGENT_CALL_TYPE GetUserData () const =0
 Returns a pointer to the user data object previously set with SetUserData() method.
 
- 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

Shader interface.

Member Function Documentation

◆ GetBytecode()

virtual void DILIGENT_CALL_TYPE Diligent.IShader.GetBytecode ( const void ** ppBytecode,
Uint64 & Size ) const
pure virtual

Returns the shader bytecode.

Parameters
[out]ppBytecode- A pointer to the memory location where a pointer to the byte code will be written.
[out]Size- The size of the byte code.

For OpenGL, this method returns the full GLSL source.

The pointer returned by the method remains valid while the shader object is alive. An application must NOT free the memory.

◆ GetConstantBufferDesc()

virtual const ShaderCodeBufferDesc *DILIGENT_CALL_TYPE Diligent.IShader.GetConstantBufferDesc ( Uint32 Index) const
pure virtual

For a constant buffer resource, returns the buffer description. See Diligent::ShaderCodeBufferDesc.

Parameters
[in]Index- Resource index, same as used by GetResourceDesc.
Returns
A pointer to ShaderCodeBufferDesc struct describing the constant buffer.

This method requires that the LoadConstantBufferReflection flag was set to true when the shader was created.

◆ GetStatus()

virtual SHADER_STATUS DILIGENT_CALL_TYPE Diligent.IShader.GetStatus ( bool WaitForCompletion = false)
pure virtual

Returns the shader status, see Diligent::SHADER_STATUS.

Parameters
[in]WaitForCompletion- If true, the method will wait until the shader is compiled. If false, the method will return the shader status without waiting. This parameter is ignored if the shader was compiled synchronously.
Returns
The shader status.