Skip to content

Commit 5c67fd0

Browse files
committed
Fix of crash in MTL loader
happened if loaded MTL asset was transformed into GPU object before loading another MTL asset
1 parent 4662239 commit 5c67fd0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/irr/asset/CGraphicsPipelineLoaderMTL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ core::smart_refctd_ptr<ICPUPipelineLayout> CGraphicsPipelineLoaderMTL::makePipel
234234
}
235235

236236
auto ds1layout = getDefaultAsset<ICPUDescriptorSetLayout, IAsset::ET_DESCRIPTOR_SET_LAYOUT>("irr/builtin/descriptor_set_layout/basic_view_parameters", m_assetMgr);
237+
// clone DS layout so that the builtin object is not used used in resulting asset (so that builtin object is not transformed into dummy asset key)
238+
// this rule concerns every asset type and every loader!
239+
ds1layout = core::smart_refctd_ptr_static_cast<ICPUDescriptorSetLayout>(ds1layout->clone(0u));
237240
core::smart_refctd_ptr<ICPUDescriptorSetLayout> ds3Layout = _noDS3 ? nullptr : core::make_smart_refctd_ptr<ICPUDescriptorSetLayout>(bindings->begin(), bindings->end());
238241
SPushConstantRange pcRng;
239242
pcRng.stageFlags = ICPUSpecializedShader::ESS_FRAGMENT;

0 commit comments

Comments
 (0)