Showing the changes to interface/src/VoxelSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include "CoverageMap.h" |
| 29 | 29 | #include "CoverageMapV2.h" |
| 30 | 30 | #include "InterfaceConfig.h" |
| 31 | +#include "Menu.h" | |
| 31 | 32 | #include "renderer/ProgramObject.h" |
| 32 | 33 | #include "VoxelConstants.h" |
| 33 | 34 | #include "VoxelSystem.h" |
| @@ -173,14 +174,16 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 139 unmodified lines | ||
| 173 | 174 | |
| 174 | 175 | switch(command) { |
| 175 | 176 | case PACKET_TYPE_VOXEL_DATA: { |
| 176 | − PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); | |
| 177 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 178 | + "readBitstreamToTree()"); | |
| 177 | 179 | // ask the VoxelTree to read the bitstream into the tree |
| 178 | 180 | ReadBitstreamToTreeParams args(WANT_COLOR, WANT_EXISTS_BITS, NULL, getDataSourceID()); |
| 179 | 181 | _tree->readBitstreamToTree(voxelData, numBytes - numBytesPacketHeader, args); |
| 180 | 182 | } |
| 181 | 183 | break; |
| 182 | 184 | case PACKET_TYPE_VOXEL_DATA_MONOCHROME: { |
| 183 | − PerformanceWarning warn(_renderWarningsOn, "readBitstreamToTree()"); | |
| 185 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 186 | + "readBitstreamToTree()"); | |
| 184 | 187 | // ask the VoxelTree to read the MONOCHROME bitstream into the tree |
| 185 | 188 | ReadBitstreamToTreeParams args(NO_COLOR, WANT_EXISTS_BITS, NULL, getDataSourceID()); |
| 186 | 189 | _tree->readBitstreamToTree(voxelData, numBytes - numBytesPacketHeader, args); |
| @@ -222,7 +225,8 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 35 unmodified lines | ||
| 222 | 225 | } |
| 223 | 226 | |
| 224 | 227 | void VoxelSystem::setupNewVoxelsForDrawing() { |
| 225 | − PerformanceWarning warn(_renderWarningsOn, "setupNewVoxelsForDrawing()"); // would like to include _voxelsInArrays, _voxelsUpdated | |
| 228 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 229 | + "setupNewVoxelsForDrawing()"); // would like to include _voxelsInArrays, _voxelsUpdated | |
| 226 | 230 | uint64_t start = usecTimestampNow(); |
| 227 | 231 | uint64_t sinceLastTime = (start - _setupNewVoxelsForDrawingLastFinished) / 1000; |
| 228 | 232 | |
| @@ -257,10 +261,10 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 28 unmodified lines | ||
| 257 | 261 | bool didWriteFullVBO = _writeRenderFullVBO; |
| 258 | 262 | if (_tree->isDirty()) { |
| 259 | 263 | static char buffer[64] = { 0 }; |
| 260 | − if (_renderWarningsOn) { | |
| 264 | + if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) { | |
| 261 | 265 | sprintf(buffer, "newTreeToArrays() _writeRenderFullVBO=%s", debug::valueOf(_writeRenderFullVBO)); |
| 262 | 266 | }; |
| 263 | − PerformanceWarning warn(_renderWarningsOn, buffer); | |
| 267 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), buffer); | |
| 264 | 268 | _callsToTreesToArrays++; |
| 265 | 269 | if (_writeRenderFullVBO) { |
| 266 | 270 | _voxelsInWriteArrays = 0; // reset our VBO |
| @@ -299,7 +303,7 @@ void VoxelSystem::setupNewVoxelsForDrawing() { · 32 unmodified lines | ||
| 299 | 303 | } |
| 300 | 304 | |
| 301 | 305 | void VoxelSystem::cleanupRemovedVoxels() { |
| 302 | − PerformanceWarning warn(_renderWarningsOn, "cleanupRemovedVoxels()"); | |
| 306 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "cleanupRemovedVoxels()"); | |
| 303 | 307 | // This handles cleanup of voxels that were culled as part of our regular out of view culling operation |
| 304 | 308 | if (!_removedVoxels.isEmpty()) { |
| 305 | 309 | while (!_removedVoxels.isEmpty()) { |
| @@ -375,7 +379,8 @@ void VoxelSystem::copyWrittenDataSegmentToReadArrays(glBufferIndex segmentStart, · 69 unmodified lines | ||
| 375 | 379 | } |
| 376 | 380 | |
| 377 | 381 | void VoxelSystem::copyWrittenDataToReadArrays(bool fullVBOs) { |
| 378 | − PerformanceWarning warn(_renderWarningsOn, "copyWrittenDataToReadArrays()"); | |
| 382 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | |
| 383 | + "copyWrittenDataToReadArrays()"); | |
| 379 | 384 | if (_voxelsDirty && _voxelsUpdated) { |
| 380 | 385 | if (fullVBOs) { |
| 381 | 386 | copyWrittenDataToReadArraysFullVBOs(); |
| @@ -509,8 +514,6 @@ glm::vec3 VoxelSystem::computeVoxelVertex(const glm::vec3& startVertex, float vo · 127 unmodified lines | ||
| 509 | 514 | ProgramObject* VoxelSystem::_perlinModulateProgram = 0; |
| 510 | 515 | |
| 511 | 516 | void VoxelSystem::init() { |
| 512 | − | |
| 513 | − _renderWarningsOn = false; | |
| 514 | 517 | _callsToTreesToArrays = 0; |
| 515 | 518 | _setupNewVoxelsForDrawingLastFinished = 0; |
| 516 | 519 | _setupNewVoxelsForDrawingLastElapsed = 0; |
| @@ -641,10 +644,11 @@ void VoxelSystem::updatePartialVBOs() { · 124 unmodified lines | ||
| 641 | 644 | |
| 642 | 645 | void VoxelSystem::updateVBOs() { |
| 643 | 646 | static char buffer[40] = { 0 }; |
| 644 | − if (_renderWarningsOn) { | |
| 647 | + if (Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings)) { | |
| 645 | 648 | sprintf(buffer, "updateVBOs() _readRenderFullVBO=%s", debug::valueOf(_readRenderFullVBO)); |
| 646 | 649 | }; |
| 647 | − PerformanceWarning warn(_renderWarningsOn, buffer); // would like to include _callsToTreesToArrays | |
| 650 | + // would like to include _callsToTreesToArrays | |
| 651 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), buffer); | |
| 648 | 652 | if (_voxelsDirty) { |
| 649 | 653 | if (_readRenderFullVBO) { |
| 650 | 654 | updateFullVBOs(); |
| @@ -672,7 +676,7 @@ void VoxelSystem::updateVBOSegment(glBufferIndex segmentStart, glBufferIndex seg · 21 unmodified lines | ||
| 672 | 676 | } |
| 673 | 677 | |
| 674 | 678 | void VoxelSystem::render(bool texture) { |
| 675 | − PerformanceWarning warn(_renderWarningsOn, "render()"); | |
| 679 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "render()"); | |
| 676 | 680 | |
| 677 | 681 | // get the lock so that the update thread won't change anything |
| 678 | 682 | pthread_mutex_lock(&_bufferWriteLock); |
| @@ -1047,7 +1051,7 @@ bool VoxelSystem::hasViewChanged() { · 368 unmodified lines | ||
| 1047 | 1051 | } |
| 1048 | 1052 | |
| 1049 | 1053 | void VoxelSystem::removeOutOfView() { |
| 1050 | − PerformanceWarning warn(_renderWarningsOn, "removeOutOfView()"); | |
| 1054 | + PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "removeOutOfView()"); | |
| 1051 | 1055 | removeOutOfViewArgs args(this); |
| 1052 | 1056 | _tree->recurseTreeWithOperation(removeOutOfViewOperation,(void*)&args); |
| 1053 | 1057 | |