Fix OOB when only a small number of Gaussians are in the view #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes multiple out-of-bound issues when only a small number of (or even 0) Gaussians are in the view:
compute_cumulative_intersects
should not accesscum_tiles_hit
, which has size 0 if no Gaussian is in the scene;compute_cov2d_bounds_tensor
should not be launched with 0 thread blocks, otherwise aCUDA invalid configuration exception
will be thrown.tile_bins
returned byget_tile_bin_edges_tensor
now has sizetile_bounds[0] * tile_bounds[1]
instead ofnum_intersects
(could be 0 if no visible Gaussian), which makes sure access totile_bins[tile_id]
in rasterization kernels guaranteed to stay in the range oftile_bins
.In addition, per @kerrj's suggestion #84 (comment), rasterization functions now directly return a tensor with all pixel values set to the background.
Closes #84.