Subpatch UUID calculator for tiled/subdivided geometry. More...
#include <BufferIndexing.h>
Public Member Functions | |
| SubpatchUUIDCalculator (uint base_UUID, helios::int2 subdivisions) | |
| Construct subpatch UUID calculator. | |
| HELIOS_HOST_DEVICE uint | getUUID (int col, int row) const |
| Get UUID for subpatch at (col, row) position. | |
| HELIOS_HOST_DEVICE int | getSubpatchCount () const |
| Get total number of subpatches. | |
| helios::int2 | getSubdivisions () const |
| Get subdivisions (useful for loop bounds) | |
Subpatch UUID calculator for tiled/subdivided geometry.
Encapsulates the subdivision offset calculation pattern. Prevents wrong dimension order (i vs j, x vs y, row vs col).
This helper makes it impossible to:
Usage in CUDA ray generation:
Historical bugs prevented (commit 53ca9687d):
Definition at line 457 of file BufferIndexing.h.
|
inline |
Construct subpatch UUID calculator.
| base_UUID | UUID of first subpatch (at position 0,0) |
| subdivisions | Subdivision counts in x and y directions |
Definition at line 476 of file BufferIndexing.h.
|
inline |
Get subdivisions (useful for loop bounds)
Definition at line 510 of file BufferIndexing.h.
|
inline |
Get total number of subpatches.
Definition at line 497 of file BufferIndexing.h.
|
inline |
Get UUID for subpatch at (col, row) position.
| col | Column index (x-direction, 0 to subdivisions.x-1) |
| row | Row index (y-direction, 0 to subdivisions.y-1) |
Parameter names make dimension order explicit - can't accidentally swap.
Definition at line 489 of file BufferIndexing.h.