Skip to content
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

bugfix/plypath: fix file path checking #8

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading