Skip to content

Commit 8bf3099

Browse files
committed
mark VBOs static
1 parent fb06959 commit 8bf3099

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

irr/src/SkinnedMesh.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// For conditions of distribution and use, see copyright notice in irrlicht.h
44

55
#include "SkinnedMesh.h"
6+
#include "EHardwareBufferFlags.h"
67
#include "SSkinMeshBuffer.h"
78
#include "Transform.h"
89
#include "aabbox3d.h"
@@ -422,6 +423,9 @@ SkinnedMesh *SkinnedMeshBuilder::finalize() &&
422423
}
423424

424425
for (auto *buffer : mesh->LocalBuffers) {
426+
// With GPU skinning, the VBOs should be static
427+
// TODO fallback to software skinning
428+
buffer->setHardwareMappingHint(EHM_STATIC);
425429
if (auto *weights = buffer->getWeights())
426430
weights->finalize();
427431
}

src/client/content_cao.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,11 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
787787
if (m_animated_meshnode) {
788788
auto *mesh = m_animated_meshnode->getMesh();
789789
// skinning happens on the CPU
790-
if (m_animated_meshnode->getJointCount() > 0)
790+
// TODO decide something proper
791+
/* if (m_animated_meshnode->getJointCount() > 0)
791792
mesh->setHardwareMappingHint(scene::EHM_STREAM, scene::EBT_VERTEX);
792793
else
793-
mesh->setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_VERTEX);
794+
mesh->setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_VERTEX); */
794795
mesh->setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_INDEX);
795796
}
796797
}

0 commit comments

Comments
 (0)