Skip to content

Commit 91e1258

Browse files
committed
Update COBJMeshFileLoader.cpp
1 parent ce642f5 commit 91e1258

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/irr/asset/COBJMeshFileLoader.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,17 @@ asset::SAssetBundle COBJMeshFileLoader::loadAsset(io::IReadFile* _file, const as
417417
if (!submeshes[i]->getPipeline())
418418
{
419419
auto pipeline = getDefaultAsset<ICPURenderpassIndependentPipeline, IAsset::ET_RENDERPASS_INDEPENDENT_PIPELINE>(hasUV? MISSING_MTL_PIPELINE_UV_CACHE_KEY: MISSING_MTL_PIPELINE_NO_UV_CACHE_KEY, AssetManager);
420+
const CMTLPipelineMetadata* metadata = static_cast<const CMTLPipelineMetadata*>(pipeline->getMetadata());
421+
auto ds3 = core::smart_refctd_ptr<ICPUDescriptorSet>(metadata->getDescriptorSet());
422+
const uint32_t pcoffset = pipeline->getLayout()->getPushConstantRanges().begin()[0].offset;
423+
submeshes[i]->setAttachedDescriptorSet(std::move(ds3));
424+
memcpy(
425+
submeshes[i]->getPushConstantsDataPtr() + pcoffset,
426+
&metadata->getMaterialParams(),
427+
sizeof(CMTLPipelineMetadata::SMTLMaterialParameters)
428+
);
420429
submeshes[i]->setPipeline(std::move(pipeline));
430+
421431
}
422432
}
423433

0 commit comments

Comments
 (0)