History

more render pipeline optimizations

ZappoMan committed 13 years ago

Commit 771c6041 parent fcce4754 files · +36 −10Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+6−1
@@ -101,6 +101,11 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 100 unmodified lines
101101 double start = usecTimestampNow();
102102 // ask the VoxelTree to read the bitstream into the tree
103103 _tree->readBitstreamToTree(voxelData, numBytes - 1);
104+ if (_renderWarningsOn && _tree->getNodesChangedFromBitstream()) {
105+ printLog("readBitstreamToTree()... getNodesChangedFromBitstream=%ld _tree->isDirty()=%s \n",
106+ _tree->getNodesChangedFromBitstream(), (_tree->isDirty() ? "yes" : "no") );
107+ }
108+
104109 double end = usecTimestampNow();
105110 double elapsedmsec = (end - start)/1000.0;
106111 if (_renderWarningsOn && elapsedmsec > 1) {
@@ -178,7 +183,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 71 unmodified lines
178183
179184 void VoxelSystem::copyWrittenDataToReadArrays() {
180185 double start = usecTimestampNow();
181− if (_voxelsDirty) {
186+ if (_voxelsDirty && _voxelsUpdated) {
182187 // lock on the buffer write lock so we can't modify the data when the GPU is reading it
183188 pthread_mutex_lock(&_bufferWriteLock);
184189 int bytesOfVertices = (_voxelsInArrays * VERTEX_POINTS_PER_VOXEL) * sizeof(GLfloat);