1.3.64
 
Loading...
Searching...
No Matches
BufferIndexing.h File Reference
#include <cstddef>
#include <climits>

Go to the source code of this file.

Data Structures

class  BufferIndexer2D
 2D buffer indexer: [dim0][dim1] More...
 
class  BufferIndexer3D
 3D buffer indexer: [dim0][dim1][dim2] More...
 
class  BufferIndexer4D
 4D buffer indexer: [dim0][dim1][dim2][dim3] More...
 
class  UUIDLookupHelper
 Safe UUID→Position lookup with automatic bounds checking. More...
 
struct  PixelCoordinate
 Camera pixel coordinate abstraction for tiled rendering. More...
 
class  SubpatchUUIDCalculator
 Subpatch UUID calculator for tiled/subdivided geometry. More...
 

Macros

#define HELIOS_HOST_DEVICE
 Type-safe buffer indexing utilities for multi-dimensional arrays.
 

Typedefs

using RadiationBufferIndexer = BufferIndexer2D
 Indexer for radiation buffers: [primitive][band].
 
using SourceFluxIndexer = BufferIndexer2D
 Indexer for source flux buffers: [source][band].
 
using MaterialPropertyIndexer = BufferIndexer3D
 Indexer for material property buffers: [source][primitive][band].
 
using SourceCameraFluxIndexer = BufferIndexer3D
 Indexer for source-camera flux buffers: [source][band][camera].
 
using CameraMaterialIndexer = BufferIndexer4D
 Indexer for camera material property buffers: [source][primitive][band][camera].
 
using SpecularRadiationIndexer = BufferIndexer4D
 Indexer for specular radiation buffers: [source][camera][primitive][band].
 

Detailed Description

Type-safe buffer indexing utilities for multi-dimensional arrays.

Copyright (C) 2016-2026 Brian Bailey

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file BufferIndexing.h.

Macro Definition Documentation

◆ HELIOS_HOST_DEVICE

#define HELIOS_HOST_DEVICE

Type-safe buffer indexing utilities for multi-dimensional arrays.

This header provides zero-overhead indexing abstractions that eliminate manual index calculations and prevent indexing errors. All indexers use row-major order (C-style) where the last dimension varies fastest.

Example usage:

// Instead of: size_t ind = prim * Nbands + band;
BufferIndexer2D indexer(Nprimitives, Nbands);
size_t ind = indexer(prim, band);
// 3D example:
MaterialPropertyIndexer indexer3d(Nsources, Nprimitives, Nbands);
size_t ind = indexer3d(source, prim, band);

Benefits:

  • Eliminates manual index calculations
  • Self-documenting code (named indexer types)
  • Compile-time argument count checking
  • Zero runtime overhead (inline functions)
  • Works in both CPU and GPU code

Definition at line 52 of file BufferIndexing.h.

Typedef Documentation

◆ CameraMaterialIndexer

Indexer for camera material property buffers: [source][primitive][band][camera].

Used for:

  • rho_cam (camera-weighted reflectivity)
  • tau_cam (camera-weighted transmissivity)

Definition at line 252 of file BufferIndexing.h.

◆ MaterialPropertyIndexer

Indexer for material property buffers: [source][primitive][band].

Used for:

  • rho (reflectivity)
  • tau (transmissivity)

Indexing: material_indexer(source_ID, primitive_position, band_global)

Definition at line 235 of file BufferIndexing.h.

◆ RadiationBufferIndexer

Indexer for radiation buffers: [primitive][band].

Used for:

  • radiation_in, radiation_out_top, radiation_out_bottom
  • scatter_buff_top, scatter_buff_bottom
  • sky_energy

Definition at line 216 of file BufferIndexing.h.

◆ SourceCameraFluxIndexer

Indexer for source-camera flux buffers: [source][band][camera].

Used for:

  • source_fluxes_cam (camera-weighted source fluxes)

Definition at line 243 of file BufferIndexing.h.

◆ SourceFluxIndexer

Indexer for source flux buffers: [source][band].

Used for:

  • source_fluxes (direct radiation)

Definition at line 224 of file BufferIndexing.h.

◆ SpecularRadiationIndexer

Indexer for specular radiation buffers: [source][camera][primitive][band].

Note: Different dimension order than camera materials!

Used for:

  • radiation_specular (specular reflection per source and camera)

Definition at line 262 of file BufferIndexing.h.