-
Notifications
You must be signed in to change notification settings - Fork 2
Improved dynamic LOD handling. #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…d support GPU-based LOD computation
…macro "fetch_$inputName(i)" which gives mat4 in case of modelMatrix input.
…macro "fetch_$inputName(i)" which gives mat4 in case of modelMatrix input.
…n case gu usage flag is WRITE or TBO max size exceeded
# Conflicts: # regen/gl-types/atomic-counter.cpp # regen/gl-types/bbox-buffer.cpp # regen/gl-types/buffer-pool.cpp # regen/glsl/regen/shapes/culling.glsl # regen/meshes/mesh-vector.cpp # regen/scene/shape-processor.cpp # regen/states/lod-state.cpp # regen/states/lod-state.h # regen/utility/conversion.cpp # regen/utility/conversion.h
Compilation -
|
| } else if (in->numElements() > 1u && memoryLayout_ == MemoryLayout::STD140) { | |
| // with STD140, each array element must be padded to a multiple of 16 bytes | |
| baseAlignment = 16u; | |
| } | |
| // Align the offset to the required alignment | |
| auto remainder = requiredSize_ % baseAlignment; |
!Line: 92 warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]regen//regen/gl-types/glsl/io-processor.cpp
Lines 300 to 305 in c721616
| for (int i=0; i<block->blockInputs().size(); i++) { | |
| auto &blockUniform = block->blockInputs()[i]; | |
| auto memberIO = getUniformIO(blockUniform); | |
| auto blockNameWithoutPrefix = getNameWithoutPrefix(blockUniform.name_.empty() ? | |
| blockUniform.in_->name() : blockUniform.name_); | |
| memberIO.ioType = ""; |
!Line: 300 warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<regen::NamedShaderInput>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]regen//regen/gl-types/glsl/io-processor.cpp
Lines 307 to 312 in c721616
| if (isSSBO && i == block->blockInputs().size() - 1) { | |
| memberIO.requiresArrayElements = false; | |
| } | |
| io.block.push_back(memberIO.declaration()); | |
| inputNames_.insert(blockNameWithoutPrefix); | |
!Line: 307 warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<regen::NamedShaderInput>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]regen//regen/gl-types/input-container.cpp
Lines 79 to 84 in c721616
| if (in->isVertexAttribute() && in->numVertices() > numVertices_) { numVertices_ = in->numVertices(); } | |
| if (in->numInstances() > 1) { | |
| numInstances_ = in->numInstances(); | |
| numVisibleInstances_ = numInstances_; | |
| } | |
| // check for instances of attributes within UBO |
!Line: 79 warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘GLint’ {aka ‘int’} [-Wsign-compare]regen//regen/gl-types/input-container.cpp
Lines 88 to 93 in c721616
| if (namedInput.in_->isVertexAttribute() && namedInput.in_->numVertices() > numVertices_) { | |
| numVertices_ = namedInput.in_->numVertices(); | |
| } | |
| if (namedInput.in_->numInstances() > 1) { | |
| numInstances_ = namedInput.in_->numInstances(); | |
| numVisibleInstances_ = numInstances_; |
!Line: 88 warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘GLint’ {aka ‘int’} [-Wsign-compare]regen//regen/gl-types/shader-input.cpp
Lines 116 to 121 in c721616
| if (v == numArrayElements_) { | |
| return; | |
| } | |
| numArrayElements_ = v; | |
| elementSize_ = dataTypeBytes_ * valsPerElement_ * numArrayElements_; | |
| if (isVertexAttribute_) { |
!Line: 116 warning: comparison of integer expressions of different signedness: ‘GLsizei’ {aka ‘int’} and ‘GLuint’ {aka ‘unsigned int’} [-Wsign-compare]regen//regen/gl-types/shader-input.cpp
Lines 511 to 516 in c721616
| if (stride_ == elementSize_) { | |
| glBufferSubData(GL_COPY_WRITE_BUFFER, offset_, inputSize_, clientData); | |
| } else { | |
| GLuint offset = offset_; | |
| for (GLuint i = 0; i < count; ++i) { | |
| glBufferSubData(GL_COPY_WRITE_BUFFER, offset, elementSize_, clientData); |
!Line: 511 warning: comparison of integer expressions of different signedness: ‘const GLsizei’ {aka ‘const int’} and ‘const GLuint’ {aka ‘const unsigned int’} [-Wsign-compare]regen//regen/gl-types/shader-input.cpp
Lines 538 to 543 in c721616
| if (stride_ == elementSize_) { | |
| std::memcpy(clientData, serverData, inputSize_); | |
| } else { | |
| for (GLuint i = 0; i < numVertices_; ++i) { | |
| std::memcpy(clientData, serverData, elementSize_); | |
| serverData += stride_; |
!Line: 538 warning: comparison of integer expressions of different signedness: ‘GLsizei’ {aka ‘int’} and ‘GLuint’ {aka ‘unsigned int’} [-Wsign-compare]regen//regen/animations/transform-animation.cpp
Lines 33 to 38 in c721616
| TransformKeyFrame f; | |
| f.pos = pos; | |
| f.rotation = rotation; | |
| f.dt = dt; | |
| frames_.push_back(f); | |
| if (frames_.size() == 1) { |
!Line: 33 warning: ‘*(regen::Vec3<float>*)((char*)&f + offsetof(regen::TransformKeyFrame, regen::TransformKeyFrame::pos.std::optional<regen::Vec3<float> >::<unnamed>.std::_Optional_base<regen::Vec3<float>, false, false>::<unnamed>)).regen::Vec3<float>::x’ may be used uninitialized [-Wmaybe-uninitialized]regen//regen/animations/transform-animation.cpp
Lines 33 to 38 in c721616
| TransformKeyFrame f; | |
| f.pos = pos; | |
| f.rotation = rotation; | |
| f.dt = dt; | |
| frames_.push_back(f); | |
| if (frames_.size() == 1) { |
!Line: 33 warning: ‘*(regen::Vec3<float>*)((char*)&f + offsetof(regen::TransformKeyFrame, regen::TransformKeyFrame::pos.std::optional<regen::Vec3<float> >::<unnamed>.std::_Optional_base<regen::Vec3<float>, false, false>::<unnamed>)).regen::Vec3<float>::y’ may be used uninitialized [-Wmaybe-uninitialized]regen//regen/animations/transform-animation.cpp
Lines 33 to 38 in c721616
| TransformKeyFrame f; | |
| f.pos = pos; | |
| f.rotation = rotation; | |
| f.dt = dt; | |
| frames_.push_back(f); | |
| if (frames_.size() == 1) { |
!Line: 33 warning: ‘*(regen::Vec3<float>*)((char*)&f + offsetof(regen::TransformKeyFrame, regen::TransformKeyFrame::rotation.std::optional<regen::Vec3<float> >::<unnamed>.std::_Optional_base<regen::Vec3<float>, false, false>::<unnamed>)).regen::Vec3<float>::x’ may be used uninitialized [-Wmaybe-uninitialized]regen//regen/animations/transform-animation.cpp
Lines 33 to 38 in c721616
| TransformKeyFrame f; | |
| f.pos = pos; | |
| f.rotation = rotation; | |
| f.dt = dt; | |
| frames_.push_back(f); | |
| if (frames_.size() == 1) { |
!Line: 33 warning: ‘*(regen::Vec3<float>*)((char*)&f + offsetof(regen::TransformKeyFrame, regen::TransformKeyFrame::rotation.std::optional<regen::Vec3<float> >::<unnamed>.std::_Optional_base<regen::Vec3<float>, false, false>::<unnamed>)).regen::Vec3<float>::y’ may be used uninitialized [-Wmaybe-uninitialized]regen//regen/textures/texture-loader.cpp
Lines 77 to 82 in c721616
| if (ilGetInteger(IL_IMAGE_FORMAT) != dstFormat || srcType != dstType) { | |
| if (ilConvertImage(dstFormat, dstType) == IL_FALSE) { | |
| throw Error("ilConvertImage failed"); | |
| } | |
| } | |
| } |
!Line: 77 warning: comparison of integer expressions of different signedness: ‘ILint’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]regen//regen/textures/texture-loader.cpp
Lines 77 to 82 in c721616
| if (ilGetInteger(IL_IMAGE_FORMAT) != dstFormat || srcType != dstType) { | |
| if (ilConvertImage(dstFormat, dstType) == IL_FALSE) { | |
| throw Error("ilConvertImage failed"); | |
| } | |
| } | |
| } |
!Line: 77 warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]regen//regen/textures/texture-loader.cpp
Lines 159 to 164 in c721616
| auto depth = ilGetInteger(IL_IMAGE_DEPTH); | |
| auto numImages = ilGetInteger(IL_NUM_IMAGES); | |
| tex->set_textureFile(file); | |
| tex->set_rectangleSize(ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT)); | |
| tex->set_pixelType(ilGetInteger(IL_IMAGE_TYPE)); |
!Line: 159 warning: unused variable ‘depth’ [-Wunused-variable]regen//regen/states/buffer-container.cpp
Lines 104 to 109 in c721616
| if (namedInput.in_->gpuUsage() == ShaderData::WRITE || inputSize > maxTBOSize) { | |
| // create SSBO for large inputs, or if usage is WRITE (i.e. the buffer is written to from a shader). | |
| nextSSBOInputs.push_back(namedInput); | |
| } | |
| else if (inputSize > maxUBOSize) { | |
| createTBO(namedInput); |
!Line: 104 warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]regen//regen/states/buffer-container.cpp
Lines 108 to 113 in c721616
| else if (inputSize > maxUBOSize) { | |
| createTBO(namedInput); | |
| if (namedInput.in_->numInstances() > 1) { | |
| inputContainer()->set_numInstances(namedInput.in_->numInstances()); | |
| } | |
| } |
!Line: 108 warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]regen//regen/states/buffer-container.cpp
Lines 115 to 120 in c721616
| if (uboSize + inputSize > maxUBOSize) { | |
| createUBO(nextUBOInputs); | |
| nextUBOInputs.clear(); | |
| uboSize = 0; | |
| } | |
| nextUBOInputs.push_back(namedInput); |
!Line: 115 warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]!Line: 687 warning: comparison of integer expressions of different signedness: ‘const GLsizei’ {aka ‘const int’} and ‘GLuint’ {aka ‘unsigned int’} [-Wsign-compare]regen//regen/states/lod-state.cpp
Lines 370 to 375 in c721616
| parallelScanMemory <= maxSharedMem && | |
| parallelScanInvocations <= maxWorkGroupInvocations); | |
| #ifdef RADIX_SERIAL_GLOBAL_SCAN | |
| useParallelScan = true; | |
| #endif | |
!Line: 370 warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]regen//regen/states/lod-state.cpp
Lines 371 to 376 in c721616
| parallelScanInvocations <= maxWorkGroupInvocations); | |
| #ifdef RADIX_SERIAL_GLOBAL_SCAN | |
| useParallelScan = true; | |
| #endif | |
| if (useParallelScan) { |
!Line: 371 warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]!Line: 680 warning: comparison of integer expressions of different signedness: ‘GLsizei’ {aka ‘int’} and ‘GLuint’ {aka ‘unsigned int’} [-Wsign-compare]regen//regen/meshes/mesh-vector.cpp
Lines 309 to 314 in c721616
| auto thresholds_i = thresholds; | |
| if (numLODs < 4) { | |
| thresholds_i.y = 0.0f; | |
| } | |
| if (numLODs < 3) { | |
| thresholds_i.z = 0.0f; |
!Line: 309 warning: variable ‘thresholds_i’ set but not used [-Wunused-but-set-variable]regen//regen/scene/mesh-processor.cpp
Lines 18 to 23 in c721616
| if (meshIndex >= 0 && meshIndex < meshes->size()) { | |
| meshQueue.push((*meshes.get())[meshIndex]); | |
| } else if (input.hasAttribute("mesh-indices")) { | |
| auto meshIndices = input.getValue("mesh-indices"); | |
| std::vector<std::string> indices; | |
| boost::split(indices, meshIndices, boost::is_any_of(",")); |
!Line: 18 warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<regen::ref_ptr<regen::Mesh> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]regen//regen/scene/mesh-processor.cpp
Lines 26 to 31 in c721616
| if (i >= 0 && i < meshes->size()) { | |
| meshQueue.push((*meshes.get())[i]); | |
| } | |
| } | |
| } else if (input.hasAttribute("mesh-index-range")) { | |
| auto meshIndexRange = input.getValue("mesh-index-range"); |
!Line: 26 warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<regen::ref_ptr<regen::Mesh> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]regen//regen/scene/mesh-processor.cpp
Lines 38 to 43 in c721616
| if (i >= 0 && i < meshes->size()) { | |
| meshQueue.push((*meshes.get())[i]); | |
| } | |
| } | |
| } | |
| } |
!Line: 38 warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<regen::ref_ptr<regen::Mesh> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]regen//applications/qt/ColorWidget.cpp
Lines 173 to 175 in c721616
| GLuint count = input_->valsPerElement(); | |
| auto sliderValue = ui_.scaleValue->value(); | |
| } |
!Line: 173 warning: unused variable ‘count’ [-Wunused-variable]regen//applications/qt/ColorWidget.cpp
Lines 174 to 175 in c721616
| auto sliderValue = ui_.scaleValue->value(); | |
| } |
!Line: 174 warning: unused variable ‘sliderValue’ [-Wunused-variable]regen//applications/scene-display/scene-display-widget.cpp
Lines 368 to 373 in c721616
| boost::filesystem::copy_file(sourceFile, | |
| fileName.toStdString(), | |
| boost::filesystem::copy_option::overwrite_if_exists); | |
| REGEN_INFO("Video saved to " << fileName.toStdString()); | |
| } | |
| }, Qt::QueuedConnection); |
!Line: 368 warning: ‘bool boost::filesystem::copy_file(const path&, const path&, copy_option)’ is deprecated: Use copy_options instead of copy_option [-Wdeprecated-declarations]
No description provided.