SpiecsEngine
 
Loading...
Searching...
No Matches

◆ AddShaderSource()

void Spices::ShaderDataBase::AddShaderSource ( std::vector< uint8_t > spirv)

Add a shader source to m_ShaderBinaries.

Parameters
[in]spirvSpirv Code .

Create shader hash for the shader.

Store the data for shader mapping when decoding GPU crash dumps. cf. FindShaderBinary()

Create shader hash for the shader.

Store the data for shader mapping when decoding GPU crash dumps. cf. FindShaderBinary()

Definition at line 72 of file NsightAftermathShaderDatabase.cpp.

73 {
75
79 const GFSDK_Aftermath_SpirvCode shader{ spirv.data(), static_cast<uint32_t>(spirv.size()) };
80 GFSDK_Aftermath_ShaderBinaryHash shaderHash;
81 AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GetShaderHashSpirv(
82 GFSDK_Aftermath_Version_API ,
83 &shader ,
84 &shaderHash
85 ));
86
91 m_ShaderBinaries[shaderHash].swap(spirv);
92 }
#define AFTERMATH_CHECK_ERROR(FC)
Helper macro for checking Nsight Aftermath results and throwing exception in case of a failure.
#define SPICES_PROFILE_ZONE
std::map< GFSDK_Aftermath_ShaderBinaryHash, std::vector< uint8_t > > m_ShaderBinaries
List of shader binaries by ShaderBinaryHash.