pub struct DemRayMarcher { /* private fields */ }Expand description
GPU-accelerated DEM ray-marching kernel.
Construct once with DemRayMarcher::new and call DemRayMarcher::march
for each DEM raster you wish to process.
Implementations§
Source§impl DemRayMarcher
impl DemRayMarcher
Sourcepub fn new(ctx: Arc<GpuContext>) -> GpuResult<Self>
pub fn new(ctx: Arc<GpuContext>) -> GpuResult<Self>
Compile the ray-march compute shader and create the GPU pipeline.
§Errors
Returns a shader compilation or pipeline creation error when the WGSL source cannot be compiled on the current device.
Sourcepub fn march(
&self,
dem: &[f32],
width: u32,
height: u32,
config: &RayMarchConfig,
) -> GpuResult<RayMarchResult>
pub fn march( &self, dem: &[f32], width: u32, height: u32, config: &RayMarchConfig, ) -> GpuResult<RayMarchResult>
Execute the ray-march kernel over the supplied DEM raster.
§Arguments
dem— flat row-major f32 elevations, length must equalwidth * height.width— number of columns in the raster.height— number of rows in the raster.config— ray-marching parameters (validated before dispatch).
§Errors
Returns an error if:
config.validate()fails.dem.len() != width * height.- Any GPU operation (buffer creation, dispatch, readback) fails.
Auto Trait Implementations§
impl !RefUnwindSafe for DemRayMarcher
impl !UnwindSafe for DemRayMarcher
impl Freeze for DemRayMarcher
impl Send for DemRayMarcher
impl Sync for DemRayMarcher
impl Unpin for DemRayMarcher
impl UnsafeUnpin for DemRayMarcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more