Skip to content

Commit d79c703

Browse files
author
kevyuu
committed
Remove reimplemented code
1 parent 00affbc commit d79c703

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

src/nbl/asset/utils/CPolygonGeometryManipulator.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -528,62 +528,6 @@ core::smart_refctd_ptr<ICPUMeshBuffer> IMeshManipulator::createMeshBufferUniqueP
528528
return clone;
529529
}
530530

531-
//
532-
core::smart_refctd_ptr<ICPUMeshBuffer> IMeshManipulator::calculateSmoothNormals(ICPUMeshBuffer* inbuffer, bool makeNewMesh, float epsilon, uint32_t normalAttrID, VxCmpFunction vxcmp)
533-
{
534-
if (inbuffer == nullptr)
535-
{
536-
_NBL_DEBUG_BREAK_IF(true);
537-
return nullptr;
538-
}
539-
540-
//Mesh has to have unique primitives
541-
if (inbuffer->getIndexType() != E_INDEX_TYPE::EIT_UNKNOWN)
542-
{
543-
_NBL_DEBUG_BREAK_IF(true);
544-
return nullptr;
545-
}
546-
547-
core::smart_refctd_ptr<ICPUMeshBuffer> outbuffer;
548-
if (makeNewMesh)
549-
{
550-
outbuffer = core::move_and_static_cast<ICPUMeshBuffer>(inbuffer->clone(0u));
551-
552-
const auto normalAttr = inbuffer->getNormalAttributeIx();
553-
auto normalBinding = inbuffer->getBindingNumForAttribute(normalAttr);
554-
const auto oldPipeline = inbuffer->getPipeline();
555-
auto vertexParams = oldPipeline->getCachedCreationParams().vertexInput;
556-
bool notUniqueBinding = false;
557-
for (uint16_t attr=0u; attr<SVertexInputParams::MAX_VERTEX_ATTRIB_COUNT; attr++)
558-
if (attr!=normalAttr && (vertexParams.enabledAttribFlags&(0x1u<<attr))!=0u && vertexParams.attributes[attr].binding==normalBinding)
559-
notUniqueBinding = true;
560-
if (notUniqueBinding)
561-
{
562-
int32_t firstBindingNotUsed = hlsl::findLSB(vertexParams.enabledBindingFlags^0xffffu);
563-
assert(firstBindingNotUsed>0 && firstBindingNotUsed<SVertexInputParams::MAX_ATTR_BUF_BINDING_COUNT);
564-
normalBinding = static_cast<uint32_t>(firstBindingNotUsed);
565-
566-
vertexParams.attributes[normalAttr].binding = normalBinding;
567-
vertexParams.enabledBindingFlags |= 0x1u<<normalBinding;
568-
}
569-
570-
const auto normalFormatBytesize = asset::getTexelOrBlockBytesize(inbuffer->getAttribFormat(normalAttr));
571-
auto normalBuf = ICPUBuffer::create({ normalFormatBytesize*IMeshManipulator::upperBoundVertexID(inbuffer) });
572-
outbuffer->setVertexBufferBinding({0ull,std::move(normalBuf)},normalBinding);
573-
574-
auto pipeline = core::move_and_static_cast<ICPURenderpassIndependentPipeline>(oldPipeline->clone(0u));
575-
vertexParams.bindings[normalBinding].stride = normalFormatBytesize;
576-
vertexParams.attributes[normalAttr].relativeOffset = 0u;
577-
pipeline->getCachedCreationParams().vertexInput = vertexParams;
578-
outbuffer->setPipeline(std::move(pipeline));
579-
}
580-
else
581-
outbuffer = core::smart_refctd_ptr<ICPUMeshBuffer>(inbuffer);
582-
CSmoothNormalGenerator::calculateNormals(outbuffer.get(), epsilon, normalAttrID, vxcmp);
583-
584-
return outbuffer;
585-
}
586-
587531
core::smart_refctd_ptr<ICPUMeshBuffer> IMeshManipulator::createOptimizedMeshBuffer(const ICPUMeshBuffer* _inbuffer, const SErrorMetric* _errMetric)
588532
{
589533
if (!_inbuffer)

0 commit comments

Comments
 (0)