mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 13:41:32 +00:00
do not dirty unchanged arrays (#3164)
This PR proposes a simple change to `RigGeometry` `dirtyGLObjects` logic. 1. We will avoid dirtying unmodified arrays. 2. We can drop an osg version guard since `Drawable::dirtyGLObjects` is not nearly as harmful as `Geometry::dirtyGLObjects`. 3. We will avoid crashes in an as yet unfinished future PR concerning `Array` sharing improvements.
This commit is contained in:
parent
6ec66edb7c
commit
b0132be53f
2 changed files with 2 additions and 10 deletions
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include <osg/Version>
|
|
||||||
|
|
||||||
namespace SceneUtil
|
namespace SceneUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -178,9 +176,7 @@ void MorphGeometry::cull(osg::NodeVisitor *nv)
|
||||||
|
|
||||||
positionDst->dirty();
|
positionDst->dirty();
|
||||||
|
|
||||||
#if OSG_MIN_VERSION_REQUIRED(3, 5, 6)
|
geom.osg::Drawable::dirtyGLObjects();
|
||||||
geom.dirtyGLObjects();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nv->pushOntoNodePath(&geom);
|
nv->pushOntoNodePath(&geom);
|
||||||
nv->apply(geom);
|
nv->apply(geom);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "riggeometry.hpp"
|
#include "riggeometry.hpp"
|
||||||
|
|
||||||
#include <osg/Version>
|
|
||||||
|
|
||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <osg/MatrixTransform>
|
#include <osg/MatrixTransform>
|
||||||
|
|
||||||
|
@ -249,9 +247,7 @@ void RigGeometry::cull(osg::NodeVisitor* nv)
|
||||||
if (tangentDst)
|
if (tangentDst)
|
||||||
tangentDst->dirty();
|
tangentDst->dirty();
|
||||||
|
|
||||||
#if OSG_MIN_VERSION_REQUIRED(3, 5, 6)
|
geom.osg::Drawable::dirtyGLObjects();
|
||||||
geom.dirtyGLObjects();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nv->pushOntoNodePath(&geom);
|
nv->pushOntoNodePath(&geom);
|
||||||
nv->apply(geom);
|
nv->apply(geom);
|
||||||
|
|
Loading…
Reference in a new issue