diff --git a/gsplat/cuda/csrc/forward.cu b/gsplat/cuda/csrc/forward.cu index da537b4ce..3751a75ff 100644 --- a/gsplat/cuda/csrc/forward.cu +++ b/gsplat/cuda/csrc/forward.cu @@ -146,12 +146,11 @@ __global__ void get_tile_bin_edges( return; // save the indices where the tile_id changes int32_t cur_tile_idx = (int32_t)(isect_ids_sorted[idx] >> 32); - if (idx == 0) { - tile_bins[cur_tile_idx].x = 0; - return; - } - if (idx == num_intersects - 1) { - tile_bins[cur_tile_idx].y = num_intersects; + if (idx == 0 || idx == num_intersects - 1) { + if (idx == 0) + tile_bins[cur_tile_idx].x = 0; + if (idx == num_intersects - 1) + tile_bins[cur_tile_idx].y = num_intersects; return; } int32_t prev_tile_idx = (int32_t)(isect_ids_sorted[idx - 1] >> 32); diff --git a/gsplat/cuda/csrc/helpers.cuh b/gsplat/cuda/csrc/helpers.cuh index dd5be7e7b..423733395 100644 --- a/gsplat/cuda/csrc/helpers.cuh +++ b/gsplat/cuda/csrc/helpers.cuh @@ -5,7 +5,7 @@ #include inline __device__ float ndc2pix(const float x, const float W, const float cx) { - return 0.5f * W * x + 0.5f + cx; + return 0.5f * W * x + cx - 0.5; } inline __device__ void get_bbox(