SpiecsEngine
 
Loading...
Searching...
No Matches

◆ AddShaderSourceWithDebugInfo()

void Spices::ShaderDataBase::AddShaderSourceWithDebugInfo ( std::vector< uint8_t > strippedSpirv,
std::vector< uint8_t > spirv )

Add a shader Source with debug info to m_ShaderBinariesWithDebugInfo.

Parameters
[in]strippedSpirv.
[in]spirv.

Generate shader debug name.

Store the data for shader instruction address mapping when decoding GPU crash dumps. cf. FindShaderBinaryWithDebugData()

Generate shader debug name.

Store the data for shader instruction address mapping when decoding GPU crash dumps. cf. FindShaderBinaryWithDebugData()

Definition at line 132 of file NsightAftermathShaderDatabase.cpp.

133 {
135
139 GFSDK_Aftermath_ShaderDebugName debugName;
140 const GFSDK_Aftermath_SpirvCode shader{ spirv.data(), static_cast<uint32_t>(spirv.size()) };
141 const GFSDK_Aftermath_SpirvCode strippedShader{ strippedSpirv.data(), static_cast<uint32_t>(strippedSpirv.size()) };
142 AFTERMATH_CHECK_ERROR(GFSDK_Aftermath_GetShaderDebugNameSpirv(
143 GFSDK_Aftermath_Version_API ,
144 &shader ,
145 &strippedShader ,
146 &debugName
147 ));
148
153 m_ShaderBinariesWithDebugInfo[debugName].swap(spirv);
154 }
#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_ShaderDebugName, std::vector< uint8_t > > m_ShaderBinariesWithDebugInfo
List of available shader binaries with source debug information by ShaderDebugName.