Skip to content

Commit 6a1bc25

Browse files
Use constant pointer to pipeline so we call const methods and not violate the isMutable asserts
1 parent 9c10e07 commit 6a1bc25

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nbl/asset/interchange/COBJMeshFileLoader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,18 @@ asset::SAssetBundle COBJMeshFileLoader::loadAsset(io::IReadFile* _file, const as
426426
}
427427
// do some checks
428428
assert(pipeline.first && pipeline.second);
429+
const auto* cPpln = pipeline.first.get();
429430
if (hasUV)
430431
{
431-
const auto& vtxParams = pipeline.first->getVertexInputParams();
432+
const auto& vtxParams = cPpln->getVertexInputParams();
432433
assert(vtxParams.attributes[POSITION].relativeOffset==offsetof(SObjVertex,pos));
433434
assert(vtxParams.attributes[NORMAL].relativeOffset==offsetof(SObjVertex,normal32bit));
434435
assert(vtxParams.attributes[UV].relativeOffset==offsetof(SObjVertex,uv));
435436
assert(vtxParams.enabledAttribFlags&(1u<<UV));
436437
assert(vtxParams.enabledBindingFlags==(1u<<BND_NUM));
437438
}
438439

439-
const uint32_t pcoffset = pipeline.first->getLayout()->getPushConstantRanges().begin()[0].offset;
440+
const uint32_t pcoffset = cPpln->getLayout()->getPushConstantRanges().begin()[0].offset;
440441
submeshes[i]->setAttachedDescriptorSet(core::smart_refctd_ptr<ICPUDescriptorSet>(pipeline.second->m_descriptorSet3));
441442
memcpy(
442443
submeshes[i]->getPushConstantsDataPtr()+pcoffset,

0 commit comments

Comments
 (0)