Skip to content

Commit

Permalink
bugfix/plypath: fix file path checking (#8)
Browse files Browse the repository at this point in the history
* Fix path checking

* Decrease reserved memory
  • Loading branch information
shg8 authored Feb 16, 2024
1 parent 951044a commit 9ba02bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions 3dgs/GSScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class GSScene {
public:
explicit GSScene(const std::string& filename)
: filename(filename) {
std::filesystem::path file = std::filesystem::current_path() / filename;
if (!std::filesystem::exists(file)) {
throw std::runtime_error("File does not exist");
// check if file exists
if (!std::filesystem::exists(filename)) {
throw std::runtime_error("File does not exist: " + filename);
}
}

Expand Down
5 changes: 4 additions & 1 deletion 3dgs/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "../vulkan/Utils.h"

#define SORT_ALLOCATE_MULTIPLIER 100
#define SORT_ALLOCATE_MULTIPLIER 10

void Renderer::initialize() {
initializeVulkan();
Expand Down Expand Up @@ -446,6 +446,9 @@ void Renderer::recordRenderCommandBuffer(uint32_t currentFrame) {

uint32_t numInstances = totalSumBufferHost->readOne<uint32_t>();
// std::cout << "Num instances: " << numInstances << std::endl;
if (numInstances > scene->getNumVertices() * SORT_ALLOCATE_MULTIPLIER) {
throw std::runtime_error("Gaussian instantiation out of memory");
}
assert(numInstances <= scene->getNumVertices() * SORT_ALLOCATE_MULTIPLIER);
for (auto i = 0; i < 8; i++) {
sortHistPipeline->bind(renderCommandBuffer, 0, i % 2 == 0 ? 0 : 1);
Expand Down

0 comments on commit 9ba02bd

Please sign in to comment.