Skip to content

Commit c3d9c08

Browse files
Render state cache: properly store input layout elements of graphics PSO create info
1 parent 98fc4cd commit c3d9c08

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Graphics/GraphicsTools/src/RenderStateCache.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,19 @@ template <>
12261226
struct ReloadablePipelineState::CreateInfoWrapper<GraphicsPipelineStateCreateInfo> : CreateInfoWrapperBase<GraphicsPipelineStateCreateInfo>
12271227
{
12281228
CreateInfoWrapper(const GraphicsPipelineStateCreateInfo& CI) :
1229-
CreateInfoWrapperBase<GraphicsPipelineStateCreateInfo>{CI}
1229+
CreateInfoWrapperBase<GraphicsPipelineStateCreateInfo>{CI},
1230+
m_LayoutElements{CI.GraphicsPipeline.InputLayout.LayoutElements, CI.GraphicsPipeline.InputLayout.LayoutElements + CI.GraphicsPipeline.InputLayout.NumElements}
12301231
{
12311232
m_Objects.emplace_back(CI.GraphicsPipeline.pRenderPass);
1233+
1234+
for (auto& Elem : m_LayoutElements)
1235+
Elem.HLSLSemantic = m_Strings.emplace(Elem.HLSLSemantic != nullptr ? Elem.HLSLSemantic : LayoutElement{}.HLSLSemantic).first->c_str();
1236+
1237+
m_CI.GraphicsPipeline.InputLayout.LayoutElements = m_LayoutElements.data();
12321238
}
1239+
1240+
private:
1241+
std::vector<LayoutElement> m_LayoutElements;
12331242
};
12341243

12351244
template <>

0 commit comments

Comments
 (0)