MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / resize

Method resize

examples/cuda/cpu/path_tracer/src/cuda/data.rs:85–95  ·  view source on GitHub ↗

Resize the image-specific buffers for a new image size.

(&mut self, new: Vec2<usize>)

Source from the content-addressed store, hash-verified

83
84 /// Resize the image-specific buffers for a new image size.
85 pub fn resize(&mut self, new: Vec2<usize>) -> CudaResult<()> {
86 self.viewport.bounds = new;
87 self.accumulated_buffer = Self::image_buffer(new)?;
88 self.out_buffer = Self::image_buffer(new)?;
89 self.denoised_buffer = Self::image_buffer(new)?;
90 self.scaled_buffer = Self::image_buffer(new)?;
91 self.rand_states = DefaultRand::initialize_states(SEED, new.product())
92 .as_slice()
93 .as_unified_buf()?;
94 Ok(())
95 }
96
97 /// Swaps out a material at a specific index.
98 pub fn update_material(&mut self, idx: usize, new: MaterialKind) {

Callers

nothing calls this directly

Calls 2

as_unified_bufMethod · 0.80
as_sliceMethod · 0.45

Tested by

no test coverage detected