Skip to content

Commit

Permalink
Windows compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffamstutz committed Jan 7, 2025
1 parent 6bf85e3 commit 2c22bc3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tsd_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ jobs:
${{github.workspace}}/tsd/cmake/build_deps
- name: Build + install ANARI-SDK
run: cmake --build ${{github.workspace}}/deps_build --config ${{ matrix.config }}
run: cmake --build ${{ github.workspace }}/deps_build --config ${{ matrix.config }}

- name: Configure TSD CMake
run: >
cmake -LA -B ${{github.workspace}}/build
-DBUILD_INTERACTIVE_APPS=OFF
-DCMAKE_PREFIX_PATH=${{github.workspace}}/deps
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DTSD_USE_ASSIMP=OFF
-DTSD_USE_CUDA=OFF
-DTSD_USE_HDF5=OFF
-DTSD_USE_OPENGL=OFF
-DTSD_USE_TBB=OFF
-DTSD_ENABLE_SERIALIZATION=OFF
${{github.workspace}}/tsd
${{ github.workspace }}/tsd
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }}
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }}

- name: Unit Tests
working-directory: ${{github.workspace}}/build
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ matrix.config }} --output-on-failure
4 changes: 4 additions & 0 deletions tsd/src/tsd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ PRIVATE
$<BUILD_INTERFACE:tsd_tinyply>
)

if (MSVC)
project_compile_options(PRIVATE /bigobj)
endif()

if (TSD_USE_CUDA)
project_compile_definitions(PUBLIC -DTSD_USE_CUDA=1)
project_link_libraries(PUBLIC CUDA::cudart)
Expand Down
4 changes: 2 additions & 2 deletions tsd/src/tsd/authoring/importers/import_DLAF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ void import_DLAF(Context &ctx,
mat->setParameterObject("color"_t, *sampler);
}

ssize_t numRemainingPoints = scene.distances.size();
constexpr ssize_t CHUNK = 1e7;
int64_t numRemainingPoints = scene.distances.size();
constexpr int64_t CHUNK = 1e7;

for (int i = 0; numRemainingPoints > 0; numRemainingPoints -= CHUNK, i++) {
const size_t numPoints =
Expand Down
4 changes: 2 additions & 2 deletions tsd/src/tsd/authoring/importers/import_NBODY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void import_NBODY(Context &ctx,
? ctx.getObject<Material>(0)
: ctx.createObject<Material>(tokens::material::matte);

ssize_t numRemainingPoints = scene.points.size();
constexpr ssize_t CHUNK = 1e7;
int64_t numRemainingPoints = scene.points.size();
constexpr int64_t CHUNK = 1e7;

for (int i = 0; numRemainingPoints > 0; numRemainingPoints -= CHUNK, i++) {
const size_t numPoints =
Expand Down
5 changes: 3 additions & 2 deletions tsd/src/tsd/core/TSDMath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ static constexpr tsd::math::float3 to_float3(const tsd::math::float4 &v)
return tsd::math::float3(v.x, v.y, v.z);
};

static constexpr bool neql(float a, float b, float eps = 1e-6f)
template <typename T>
static constexpr bool neql(T a, T b, T eps = 1e-6)
{
return std::abs(a - b) <= eps;
}
Expand All @@ -39,7 +40,7 @@ static constexpr tsd::math::float3 radians(tsd::math::float3 v)

static constexpr float degrees(float radians)
{
return radians * 180.f / M_PI;
return radians * 180.f / float(M_PI);
};

static constexpr tsd::math::float3 degrees(tsd::math::float3 v)
Expand Down

0 comments on commit 2c22bc3

Please sign in to comment.