pub struct Gpu {
pub device: Device,
pub queue: Queue,
pub adapter: Adapter,
/* private fields */
}Expand description
The device and the one pipeline per target format.
Fields§
§device: Device§queue: Queue§adapter: AdapterImplementations§
Source§impl Gpu
impl Gpu
Sourcepub fn new(
instance: &Instance,
compatible: Option<&Surface<'_>>,
prefer: Option<(u32, u32)>,
allow_software: bool,
) -> Result<Gpu, String>
pub fn new( instance: &Instance, compatible: Option<&Surface<'_>>, prefer: Option<(u32, u32)>, allow_software: bool, ) -> Result<Gpu, String>
Opens a device able to present to compatible (or any device, for
drawing off-screen): the adapter with PCI ids prefer when there is
one (the adapter the monitors are plugged into), else a low-power one.
Sourcepub fn canvas(&self, player: &Player) -> Canvas
pub fn canvas(&self, player: &Player) -> Canvas
Puts the player’s current frame and palette on the GPU.
Sourcepub fn upload(&self, canvas: &mut Canvas, player: &Player, rects: &[PixelRect])
pub fn upload(&self, canvas: &mut Canvas, player: &Player, rects: &[PixelRect])
Copies those rectangles of the player’s frame to the canvas: one upload buffer and one command buffer, however many rectangles.
Sourcepub fn draw(
&mut self,
canvas: &Canvas,
target: &TextureView,
format: TextureFormat,
)
pub fn draw( &mut self, canvas: &Canvas, target: &TextureView, format: TextureFormat, )
Draws the canvas into target (a surface texture or an off-screen
one) and submits.
Auto Trait Implementations§
impl !RefUnwindSafe for Gpu
impl !UnwindSafe for Gpu
impl Forget for Gpu
impl Freeze for Gpu
impl Move for Gpu
impl Send for Gpu
impl Sync for Gpu
impl Unpin for Gpu
impl UnsafeUnpin for Gpu
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