SpatialGrid
The SpatialGrid class provides a framework for managing and processing spatial data using a grid-based approach. It supports efficient creation, dispatch, and manipulation of the spatial grid, utilizing radix sorting and customizable dispatch operations. With its methods for grid creation, dispatching grid generation, and managing the spatial elements, the class is well-suited for applications that require fast, scalable spatial partitioning and computation, such as in graphics rendering, simulations, and physics-based applications.
#include <parallel/TellusimSpatialGrid.h>
Constructors
SpatialGrid()
Methods
Clear grid.
void clear()
Check grid.
bool isCreated() const
Grid parameters.
uint32_t getGroupSize() const
RadixSort getRadixSort() const
Create spatial grid.
bool create(const Device &device, RadixSort &sort, uint32_t groups = 256)
Dispatch spatial grid generation.
bool dispatch(Compute &compute, Buffer &data, uint32_t offset, uint32_t size, uint32_t bits = 32)
Type | Name | Description |
---|---|---|
Buffer | data | Spatial grid of uint32_t elements. |
uint32_t | offset | Spatial grid offset index. |
uint32_t | size | Number of spatial elements. |
uint32_t | bits | Number of hash bits to sort. |
Dispatch spatial tree generation.
bool dispatchIndirect(Compute &compute, Buffer &data, Buffer &dispatch, uint32_t offset, uint32_t max_size = Maxu32)
Type | Name | Description |
---|---|---|
Buffer | data | Spatial grid of uint32_t elements. |
Buffer | dispatch | Dispatch indirect buffer. |
uint32_t | offset | Dispatch indirect buffer offset. |
uint32_t | max_size | Maximum number of spatial elements. |
Structs
DispatchParameters
.
Variables
Type | Name | Description |
---|---|---|
uint32_t | offset | Spatial grid offset index. |
uint32_t | size | Number of spatial elements. |
uint32_t | padding_0 | |
uint32_t | padding_1 |