History

fix issue with duplicate VBO slots

ZappoMan committed 13 years ago

Commit 8560e421 parent 1c427c91 file · +13 −3Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/VoxelSystem.cpp+13−3
@@ -372,7 +372,10 @@ int VoxelSystem::updateNodeInArraysAsFullVBO(VoxelNode* node) { · 371 unmodified lines
372372 _writeVoxelDirtyArray[nodeIndex] = true; // just in case we switch to Partial mode
373373 _voxelsInWriteArrays++; // our know vertices in the arrays
374374 return 1; // rendered
375− }
375+ } else {
376+ node->setBufferIndex(GLBUFFER_INDEX_UNKNOWN);
377+ }
378+
376379 return 0; // not-rendered
377380 }
378381
@@ -978,6 +981,7 @@ public: · 599 unmodified lines
978981 shouldRenderNodes(0),
979982 coloredNodes(0),
980983 nodesInVBO(0),
984+ nodesInVBONotShouldRender(0),
981985 nodesInVBOOverExpectedMax(0),
982986 duplicateVBOIndex(0),
983987 leafNodes(0)
@@ -990,6 +994,7 @@ public: · 6 unmodified lines
990994 unsigned long shouldRenderNodes;
991995 unsigned long coloredNodes;
992996 unsigned long nodesInVBO;
997+ unsigned long nodesInVBONotShouldRender;
993998 unsigned long nodesInVBOOverExpectedMax;
994999 unsigned long duplicateVBOIndex;
9951000 unsigned long leafNodes;
@@ -1032,6 +1037,11 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* ex · 36 unmodified lines
10321037 if (nodeIndex > args->expectedMax) {
10331038 args->nodesInVBOOverExpectedMax++;
10341039 }
1040+
1041+ // if it's in VBO but not-shouldRender, track that also...
1042+ if (!node->getShouldRender()) {
1043+ args->nodesInVBONotShouldRender++;
1044+ }
10351045 }
10361046
10371047 return true; // keep going!
@@ -1060,8 +1070,8 @@ void VoxelSystem::collectStatsForTreesAndVBOs() { · 22 unmodified lines
10601070 printLog("stats: total %ld, leaves %ld, dirty %ld, colored %ld, shouldRender %ld, inVBO %ld\n",
10611071 args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
10621072
1063− printLog("inVBO %ld, nodesInVBOOverExpectedMax %ld, duplicateVBOIndex %ld\n",
1064− args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex);
1073+ printLog("inVBO %ld, nodesInVBOOverExpectedMax %ld, duplicateVBOIndex %ld, nodesInVBONotShouldRender %ld\n",
1074+ args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
10651075
10661076 glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
10671077 glBufferIndex maxInVBO = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t