pub trait Device: Sized {
type Resources: Resources;
type CommandBuffer: Buffer<Self::Resources>;
// Required methods
fn get_capabilities(&self) -> &Capabilities;
fn pin_submitted_resources(&mut self, _: &Manager<Self::Resources>);
fn submit(
&mut self,
_: &mut Self::CommandBuffer,
access: &AccessInfo<Self::Resources>
) -> Result<(), SubmissionError>;
fn fenced_submit(
&mut self,
_: &mut Self::CommandBuffer,
access: &AccessInfo<Self::Resources>,
after: Option<Fence<Self::Resources>>
) -> Result<Fence<Self::Resources>, SubmissionError>;
fn wait_fence(&mut self, _: &Fence<Self::Resources>);
fn cleanup(&mut self);
}
Expand description
A Device
is responsible for submitting CommandBuffer
s to the GPU.
Required Associated Types§
sourcetype CommandBuffer: Buffer<Self::Resources>
type CommandBuffer: Buffer<Self::Resources>
Associated CommandBuffer
type. Every Device
type can only work with one CommandBuffer
type.
Required Methods§
sourcefn get_capabilities(&self) -> &Capabilities
fn get_capabilities(&self) -> &Capabilities
Returns the capabilities of this Device
.
sourcefn pin_submitted_resources(&mut self, _: &Manager<Self::Resources>)
fn pin_submitted_resources(&mut self, _: &Manager<Self::Resources>)
Pin everything from this handle manager to live for a frame.
sourcefn submit(
&mut self,
_: &mut Self::CommandBuffer,
access: &AccessInfo<Self::Resources>
) -> Result<(), SubmissionError>
fn submit( &mut self, _: &mut Self::CommandBuffer, access: &AccessInfo<Self::Resources> ) -> Result<(), SubmissionError>
Submits a CommandBuffer
to the GPU for execution.
sourcefn fenced_submit(
&mut self,
_: &mut Self::CommandBuffer,
access: &AccessInfo<Self::Resources>,
after: Option<Fence<Self::Resources>>
) -> Result<Fence<Self::Resources>, SubmissionError>
fn fenced_submit( &mut self, _: &mut Self::CommandBuffer, access: &AccessInfo<Self::Resources>, after: Option<Fence<Self::Resources>> ) -> Result<Fence<Self::Resources>, SubmissionError>
Submits a CommandBuffer
to the GPU for execution.
returns a fence that is signaled after the GPU has executed all commands
sourcefn wait_fence(&mut self, _: &Fence<Self::Resources>)
fn wait_fence(&mut self, _: &Fence<Self::Resources>)
Stalls the current thread until the fence is satisfied