MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / LoadShaderLibraryIfNeeded

Method LoadShaderLibraryIfNeeded

Rtxpt/SampleCommon/PTPipelineBaker.cpp:91–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void PTPipelineVariant::ShaderPermutation::LoadShaderLibraryIfNeeded(PTPipelineBaker & baker)
92{
93 if (US_compileError != "" || ShaderLibrary != nullptr)
94 return;
95
96 std::shared_ptr<donut::vfs::IBlob> data = baker.GetFS()->readFile(("/" + c_PTShaderBinariesRoot + "/" + CompiledFileNameNoExt + ".bin").c_str());
97
98 if (data)
99 ShaderLibrary = baker.GetDevice()->createShaderLibrary(data->data(), data->size());
100
101 if (!ShaderLibrary)
102 US_compileError = StringFormat("ERROR creating ShaderLibrary for file %s", CompiledFullPath.c_str());
103}
104
105PTPipelineVariant::PTPipelineVariant(const std::string & relativeSourcePath, const std::vector<donut::engine::ShaderMacro> & variantMacros, const std::shared_ptr<PTPipelineBaker>& baker, const std::string & shortUniqueDebugID, bool raygenOnly)
106 : m_macros(variantMacros), m_baker(baker), m_rayGenOnly(raygenOnly)

Callers 1

UpdateMethod · 0.80

Calls 3

StringFormatFunction · 0.85
GetFSMethod · 0.45
GetDeviceMethod · 0.45

Tested by

no test coverage detected