Skip to content

Commit

Permalink
add a sanity check for empty file argument
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeneren committed Jan 6, 2020
1 parent f6b7027 commit b546e3a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ atmosphere earth_atmosphere;
bool env_tex = false;
std::string env_tex_name;

bool empty_volume = false;

#define check_success(expr) \
do { \
Expand Down Expand Up @@ -1018,7 +1019,7 @@ static void read_instance_file(std::string file_name) {

check_success(cuMemAlloc(&d_lights, sizeof(light_list)) == cudaSuccess);
check_success(cuMemcpyHtoD(d_lights, &l_list, sizeof(light_list)) == cudaSuccess);

empty_volume = true;
}
else {

Expand Down Expand Up @@ -1312,7 +1313,12 @@ int main(const int argc, const char* argv[])
}
else { // No vdb or instance file is given procede with procedural volume
log("No vdb file or an instance file is provided. Continuing with procedural volume", LOG);
// Test procedural volume

}


if (empty_volume) {

proc_box_min = make_float3(-230, -100, -228);
proc_box_max = make_float3(230, 100, 244);
if (!proc_vol.create_volume(proc_box_min, proc_box_max, 1.0f, 0, 0.1f)) return 0;
Expand All @@ -1322,9 +1328,6 @@ int main(const int argc, const char* argv[])







// Send volume instances to gpu

Expand Down

0 comments on commit b546e3a

Please sign in to comment.