Skip to content

Commit

Permalink
fixing edge case with single intersection (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
vye16 authored Jan 3, 2024
1 parent 9b56b47 commit bae8738
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions gsplat/cuda/csrc/forward.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion gsplat/cuda/csrc/helpers.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>

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(
Expand Down

0 comments on commit bae8738

Please sign in to comment.