Skip to content

Commit 3b60e5e

Browse files
EnvMapRenderer: fixed shader reload crash
1 parent d88a55f commit 3b60e5e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Components/src/EnvMapRenderer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,8 @@ IPipelineState* EnvMapRenderer::GetPSO(const PSOKey& Key)
105105

106106
RenderDeviceWithCache_N Device{m_pDevice, m_pStateCache};
107107

108-
std::string PSMainSource = m_PSMainSource;
109-
if (PSMainSource.empty())
110-
PSMainSource = DefaultPSMain;
111-
112108
RefCntAutoPtr<IShaderSourceInputStreamFactory> pMemorySourceFactory =
113-
CreateMemoryShaderSourceFactory({MemoryShaderSourceFileInfo{"PSMainGenerated.generated", PSMainSource}});
109+
CreateMemoryShaderSourceFactory({MemoryShaderSourceFileInfo{"PSMainGenerated.generated", !m_PSMainSource.empty() ? m_PSMainSource.c_str() : DefaultPSMain}});
114110
RefCntAutoPtr<IShaderSourceInputStreamFactory> pShaderSourceFactory =
115111
CreateCompoundShaderSourceFactory({&DiligentFXShaderSourceStreamFactory::GetInstance(), pMemorySourceFactory});
116112

0 commit comments

Comments
 (0)