pub struct GpuTextureHandle {
pub id: u64,
pub width: u32,
pub height: u32,
pub format: SwapchainFormat,
pub is_depth_stencil: bool,
pub data: Vec<u8>,
}Expand description
Abstract hardware GPU texture handle.
Fields§
§id: u64§width: u32§height: u32§format: SwapchainFormat§is_depth_stencil: bool§data: Vec<u8>Implementations§
Source§impl GpuTextureHandle
impl GpuTextureHandle
pub fn new( id: u64, width: u32, height: u32, format: SwapchainFormat, is_depth: bool, ) -> Self
pub fn write_pixels(&mut self, pixels: &[u8])
Sourcepub fn read_pixel_rgba(&self, x: u32, y: u32) -> Option<[u8; 4]>
pub fn read_pixel_rgba(&self, x: u32, y: u32) -> Option<[u8; 4]>
Reads RGBA pixel at integer coordinates.
Sourcepub fn read_depth(&self, x: u32, y: u32) -> Option<f32>
pub fn read_depth(&self, x: u32, y: u32) -> Option<f32>
Reads 32-bit floating point depth value at integer coordinates.
Sourcepub fn clear(&mut self, color: [f32; 4], scissor: Option<Rect>)
pub fn clear(&mut self, color: [f32; 4], scissor: Option<Rect>)
Clears texture contents to specified color with optional scissor rect clipping.
Sourcepub fn clear_depth(&mut self, depth: f32, scissor: Option<Rect>)
pub fn clear_depth(&mut self, depth: f32, scissor: Option<Rect>)
Clears 32-bit floating point depth texture with optional scissor rect clipping.
Trait Implementations§
Source§impl Clone for GpuTextureHandle
impl Clone for GpuTextureHandle
Auto Trait Implementations§
impl Forget for GpuTextureHandle
impl Freeze for GpuTextureHandle
impl Move for GpuTextureHandle
impl RefUnwindSafe for GpuTextureHandle
impl Send for GpuTextureHandle
impl Sync for GpuTextureHandle
impl Unpin for GpuTextureHandle
impl UnsafeUnpin for GpuTextureHandle
impl UnwindSafe for GpuTextureHandle
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