mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:53:01 +02:00
fix issue with duplicate VBO slots
This commit is contained in:
parent
1c427c9a02
commit
8560e42357
1 changed files with 13 additions and 3 deletions
|
@ -372,7 +372,10 @@ int VoxelSystem::updateNodeInArraysAsFullVBO(VoxelNode* node) {
|
||||||
_writeVoxelDirtyArray[nodeIndex] = true; // just in case we switch to Partial mode
|
_writeVoxelDirtyArray[nodeIndex] = true; // just in case we switch to Partial mode
|
||||||
_voxelsInWriteArrays++; // our know vertices in the arrays
|
_voxelsInWriteArrays++; // our know vertices in the arrays
|
||||||
return 1; // rendered
|
return 1; // rendered
|
||||||
}
|
} else {
|
||||||
|
node->setBufferIndex(GLBUFFER_INDEX_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
return 0; // not-rendered
|
return 0; // not-rendered
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -978,6 +981,7 @@ public:
|
||||||
shouldRenderNodes(0),
|
shouldRenderNodes(0),
|
||||||
coloredNodes(0),
|
coloredNodes(0),
|
||||||
nodesInVBO(0),
|
nodesInVBO(0),
|
||||||
|
nodesInVBONotShouldRender(0),
|
||||||
nodesInVBOOverExpectedMax(0),
|
nodesInVBOOverExpectedMax(0),
|
||||||
duplicateVBOIndex(0),
|
duplicateVBOIndex(0),
|
||||||
leafNodes(0)
|
leafNodes(0)
|
||||||
|
@ -990,6 +994,7 @@ public:
|
||||||
unsigned long shouldRenderNodes;
|
unsigned long shouldRenderNodes;
|
||||||
unsigned long coloredNodes;
|
unsigned long coloredNodes;
|
||||||
unsigned long nodesInVBO;
|
unsigned long nodesInVBO;
|
||||||
|
unsigned long nodesInVBONotShouldRender;
|
||||||
unsigned long nodesInVBOOverExpectedMax;
|
unsigned long nodesInVBOOverExpectedMax;
|
||||||
unsigned long duplicateVBOIndex;
|
unsigned long duplicateVBOIndex;
|
||||||
unsigned long leafNodes;
|
unsigned long leafNodes;
|
||||||
|
@ -1032,6 +1037,11 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* ex
|
||||||
if (nodeIndex > args->expectedMax) {
|
if (nodeIndex > args->expectedMax) {
|
||||||
args->nodesInVBOOverExpectedMax++;
|
args->nodesInVBOOverExpectedMax++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if it's in VBO but not-shouldRender, track that also...
|
||||||
|
if (!node->getShouldRender()) {
|
||||||
|
args->nodesInVBONotShouldRender++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // keep going!
|
return true; // keep going!
|
||||||
|
@ -1060,8 +1070,8 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
|
||||||
printLog("stats: total %ld, leaves %ld, dirty %ld, colored %ld, shouldRender %ld, inVBO %ld\n",
|
printLog("stats: total %ld, leaves %ld, dirty %ld, colored %ld, shouldRender %ld, inVBO %ld\n",
|
||||||
args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
|
args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
|
||||||
|
|
||||||
printLog("inVBO %ld, nodesInVBOOverExpectedMax %ld, duplicateVBOIndex %ld\n",
|
printLog("inVBO %ld, nodesInVBOOverExpectedMax %ld, duplicateVBOIndex %ld, nodesInVBONotShouldRender %ld\n",
|
||||||
args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex);
|
args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
|
||||||
|
|
||||||
glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
|
glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
|
||||||
glBufferIndex maxInVBO = 0;
|
glBufferIndex maxInVBO = 0;
|
||||||
|
|
Loading…
Reference in a new issue