Enum rafx_api::RafxDeviceContext
source · pub enum RafxDeviceContext {
Empty(RafxDeviceContextEmpty),
}
Expand description
A cloneable, thread-safe handle used to create graphics resources.
All device contexts, and resources created from them, must be dropped before the RafxApi
object that they came from is dropped or destroyed.
Variants§
Empty(RafxDeviceContextEmpty)
Implementations§
source§impl RafxDeviceContext
impl RafxDeviceContext
pub fn is_dx12(&self) -> bool
pub fn is_vulkan(&self) -> bool
pub fn is_metal(&self) -> bool
pub fn is_gles3(&self) -> bool
pub fn is_gles2(&self) -> bool
pub fn api_type(&self) -> RafxApiType
sourcepub fn device_info(&self) -> &RafxDeviceInfo
pub fn device_info(&self) -> &RafxDeviceInfo
Get metadata about the device
pub fn find_supported_format( &self, candidates: &[RafxFormat], resource_type: RafxResourceType ) -> Option<RafxFormat>
pub fn find_supported_sample_count( &self, candidates: &[RafxSampleCount] ) -> Option<RafxSampleCount>
sourcepub fn create_queue(&self, queue_type: RafxQueueType) -> RafxResult<RafxQueue>
pub fn create_queue(&self, queue_type: RafxQueueType) -> RafxResult<RafxQueue>
Create a queue
sourcepub fn create_fence(&self) -> RafxResult<RafxFence>
pub fn create_fence(&self) -> RafxResult<RafxFence>
Create a fence
sourcepub fn create_semaphore(&self) -> RafxResult<RafxSemaphore>
pub fn create_semaphore(&self) -> RafxResult<RafxSemaphore>
Create a semaphore
sourcepub fn create_swapchain(
&self,
raw_display_handle: &dyn HasRawDisplayHandle,
raw_window_handle: &dyn HasRawWindowHandle,
present_queue: &RafxQueue,
swapchain_def: &RafxSwapchainDef
) -> RafxResult<RafxSwapchain>
pub fn create_swapchain( &self, raw_display_handle: &dyn HasRawDisplayHandle, raw_window_handle: &dyn HasRawWindowHandle, present_queue: &RafxQueue, swapchain_def: &RafxSwapchainDef ) -> RafxResult<RafxSwapchain>
Create a swapchain
sourcepub fn wait_for_fences(&self, fences: &[&RafxFence]) -> RafxResult<()>
pub fn wait_for_fences(&self, fences: &[&RafxFence]) -> RafxResult<()>
Wait for the given fences to complete. If a fence is in an unsubmitted state, the fence is ignored.
sourcepub fn create_sampler(
&self,
sampler_def: &RafxSamplerDef
) -> RafxResult<RafxSampler>
pub fn create_sampler( &self, sampler_def: &RafxSamplerDef ) -> RafxResult<RafxSampler>
Create a sampler
sourcepub fn create_texture(
&self,
texture_def: &RafxTextureDef
) -> RafxResult<RafxTexture>
pub fn create_texture( &self, texture_def: &RafxTextureDef ) -> RafxResult<RafxTexture>
Create a texture
sourcepub fn create_buffer(
&self,
buffer_def: &RafxBufferDef
) -> RafxResult<RafxBuffer>
pub fn create_buffer( &self, buffer_def: &RafxBufferDef ) -> RafxResult<RafxBuffer>
Create a buffer
pub fn create_shader_module( &self, shader_module_def: RafxShaderModuleDef<'_> ) -> RafxResult<RafxShaderModule>
sourcepub fn create_shader(
&self,
stages: Vec<RafxShaderStageDef>
) -> RafxResult<RafxShader>
pub fn create_shader( &self, stages: Vec<RafxShaderStageDef> ) -> RafxResult<RafxShader>
Create a shader
sourcepub fn create_root_signature(
&self,
root_signature_def: &RafxRootSignatureDef<'_>
) -> RafxResult<RafxRootSignature>
pub fn create_root_signature( &self, root_signature_def: &RafxRootSignatureDef<'_> ) -> RafxResult<RafxRootSignature>
Create a root signature
sourcepub fn create_graphics_pipeline(
&self,
pipeline_def: &RafxGraphicsPipelineDef<'_>
) -> RafxResult<RafxPipeline>
pub fn create_graphics_pipeline( &self, pipeline_def: &RafxGraphicsPipelineDef<'_> ) -> RafxResult<RafxPipeline>
Create a graphics pipeline
sourcepub fn create_compute_pipeline(
&self,
pipeline_def: &RafxComputePipelineDef<'_>
) -> RafxResult<RafxPipeline>
pub fn create_compute_pipeline( &self, pipeline_def: &RafxComputePipelineDef<'_> ) -> RafxResult<RafxPipeline>
Create a compute pipeline
sourcepub fn create_descriptor_set_array(
&self,
descriptor_set_array_def: &RafxDescriptorSetArrayDef<'_>
) -> RafxResult<RafxDescriptorSetArray>
pub fn create_descriptor_set_array( &self, descriptor_set_array_def: &RafxDescriptorSetArrayDef<'_> ) -> RafxResult<RafxDescriptorSetArray>
Create a descriptor set array
sourcepub fn empty_device_context(&self) -> Option<&RafxDeviceContextEmpty>
pub fn empty_device_context(&self) -> Option<&RafxDeviceContextEmpty>
Get the underlying metal API object. This provides access to any internally created metal objects.
Trait Implementations§
source§impl Clone for RafxDeviceContext
impl Clone for RafxDeviceContext
source§fn clone(&self) -> RafxDeviceContext
fn clone(&self) -> RafxDeviceContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for RafxDeviceContext
impl Send for RafxDeviceContext
impl Sync for RafxDeviceContext
impl Unpin for RafxDeviceContext
impl UnwindSafe for RafxDeviceContext
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.