pub struct Texture { /* private fields */ }Expand description
The Texture struct provides deterministic CPU texels for shader sampling, image access, and atomic assertions.
Implementations§
Source§impl Texture
impl Texture
pub fn new(width: u32, height: u32) -> Result<Self, VmError>
Sourcepub fn new_3d(width: u32, height: u32, depth: u32) -> Result<Self, VmError>
pub fn new_3d(width: u32, height: u32, depth: u32) -> Result<Self, VmError>
Creates a CPU texture with three-dimensional addressing for VM texture tests.
pub fn write(&mut self, coord: [u32; 2], value: [f32; 4]) -> Result<(), VmError>
Sourcepub fn write_3d(
&mut self,
coord: [u32; 3],
value: [f32; 4],
) -> Result<(), VmError>
pub fn write_3d( &mut self, coord: [u32; 3], value: [f32; 4], ) -> Result<(), VmError>
Writes one texel in a three-dimensional CPU texture.
Sourcepub fn write_u32(&mut self, coord: [u32; 2], value: u32) -> Result<(), VmError>
pub fn write_u32(&mut self, coord: [u32; 2], value: u32) -> Result<(), VmError>
Writes one unsigned integer texel for integer image and atomic tests.
Sourcepub fn fetch(&self, coord: [u32; 2]) -> Result<Value, VmError>
pub fn fetch(&self, coord: [u32; 2]) -> Result<Value, VmError>
Fetches one texel without interpolation.
Sourcepub fn fetch_u32(&self, coord: [u32; 2]) -> Result<Value, VmError>
pub fn fetch_u32(&self, coord: [u32; 2]) -> Result<Value, VmError>
Fetches one unsigned integer texel without interpolation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texture
impl UnwindSafe for Texture
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