diff --git a/gsplat/cuda/csrc/forward.cu b/gsplat/cuda/csrc/forward.cu index c737bd54a..48221e7b0 100644 --- a/gsplat/cuda/csrc/forward.cu +++ b/gsplat/cuda/csrc/forward.cu @@ -277,7 +277,11 @@ void bin_and_sort_gaussians( // sort intersections by ascending tile ID and depth with RadixSort int32_t max_tile_id = (int32_t)(tile_bounds.x * tile_bounds.y); +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) + int msb = 32 - __lzcnt(max_tile_id) + 1; +#else int msb = 32 - __builtin_clz(max_tile_id) + 1; +#endif // allocate workspace memory void *sort_ws = nullptr; size_t sort_ws_bytes; @@ -662,7 +666,7 @@ __device__ float3 project_cov3d_ewa( glm::mat3 cov = T * V * glm::transpose(T); // add a little blur along axes and save upper triangular elements - return float3(float(cov[0][0]) + 0.3f, float(cov[0][1]), float(cov[1][1]) + 0.3f); + return make_float3(float(cov[0][0]) + 0.3f, float(cov[0][1]), float(cov[1][1]) + 0.3f); } // device helper to get 3D covariance from scale and quat parameters