Skip to content

Commit

Permalink
Fix windows specific crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
jammm authored and vork committed Aug 29, 2024
1 parent 8a667f1 commit 47a99bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions texture_baker/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import glob
import os
import platform

import torch
from setuptools import find_packages, setup
Expand Down Expand Up @@ -39,6 +40,10 @@ def get_extensions():
}
if debug_mode:
extra_compile_args["cxx"].append("-g")
if platform.system() == "Windows":
extra_compile_args["cxx"].append("/Z7")
extra_compile_args["cxx"].append("/Od")
extra_link_args.extend(["/DEBUG"])
extra_compile_args["cxx"].append("-UNDEBUG")
extra_compile_args["nvcc"].append("-UNDEBUG")
extra_compile_args["nvcc"].append("-g")
Expand Down
3 changes: 2 additions & 1 deletion texture_baker/texture_baker/csrc/baker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ namespace texture_baker_cpp
std::iota(triangle_indices.begin(), triangle_indices.end(), 0);

// Build BVH nodes
nodes.reserve(triangles.size());
// Reserve extra capacity to fix windows specific crashes
nodes.reserve(triangles.size()*2+1);
nodes.push_back({}); // Create the root node
root = 0;

Expand Down

0 comments on commit 47a99bd

Please sign in to comment.