gfx_backend_empty

Struct Device

Source
pub struct Device;
Expand description

Dummy device doing nothing.

Trait Implementations§

Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Device<Backend> for Device

Source§

unsafe fn create_command_pool( &self, _: QueueFamilyId, _: CommandPoolCreateFlags, ) -> Result<CommandPool, OutOfMemory>

Create a new command pool for a given queue family. Read more
Source§

unsafe fn destroy_command_pool(&self, _: CommandPool)

Destroy a command pool.
Source§

unsafe fn allocate_memory( &self, memory_type: MemoryTypeId, size: u64, ) -> Result<Memory, AllocationError>

Allocates a memory segment of a specified type. Read more
Source§

unsafe fn create_render_pass<'a, Ia, Is, Id>( &self, _: Ia, _: Is, _: Id, ) -> Result<(), OutOfMemory>
where Is: Iterator<Item = SubpassDesc<'a>>,

Create a render pass with the given attachments and subpasses. Read more
Source§

unsafe fn create_pipeline_layout<'a, Is, Ic>( &self, _: Is, _: Ic, ) -> Result<(), OutOfMemory>
where Is: Iterator<Item = &'a DescriptorSetLayout>,

Create a new pipeline layout object. Read more
Source§

unsafe fn create_pipeline_cache( &self, _data: Option<&[u8]>, ) -> Result<(), OutOfMemory>

Create a pipeline cache object.
Source§

unsafe fn get_pipeline_cache_data( &self, _cache: &(), ) -> Result<Vec<u8>, OutOfMemory>

Retrieve data from pipeline cache object.
Source§

unsafe fn destroy_pipeline_cache(&self, _: ())

Destroy a pipeline cache object.
Source§

unsafe fn create_graphics_pipeline<'a>( &self, _: &GraphicsPipelineDesc<'a, Backend>, _: Option<&()>, ) -> Result<(), CreationError>

Create a graphics pipeline. Read more
Source§

unsafe fn create_compute_pipeline<'a>( &self, _: &ComputePipelineDesc<'a, Backend>, _: Option<&()>, ) -> Result<(), CreationError>

Create a compute pipeline.
Source§

unsafe fn merge_pipeline_caches<'a, I>( &self, _: &mut (), _: I, ) -> Result<(), OutOfMemory>
where I: Iterator<Item = &'a ()>,

Merge a number of source pipeline caches into the target one.
Source§

unsafe fn create_framebuffer<I>( &self, _: &(), _: I, _: Extent, ) -> Result<(), OutOfMemory>

Create a new framebuffer object. Read more
Source§

unsafe fn create_shader_module(&self, _: &[u32]) -> Result<(), ShaderError>

Create a new shader module object from the SPIR-V binary data. Read more
Source§

unsafe fn create_sampler(&self, _: &SamplerDesc) -> Result<(), AllocationError>

Create a new sampler object
Source§

unsafe fn create_buffer( &self, size: u64, _: Usage, _: SparseFlags, ) -> Result<Buffer, CreationError>

Create a new buffer (unbound). Read more
Source§

unsafe fn get_buffer_requirements(&self, buffer: &Buffer) -> Requirements

Get memory requirements for the buffer
Source§

unsafe fn bind_buffer_memory( &self, _memory: &Memory, _: u64, _: &mut Buffer, ) -> Result<(), BindError>

Bind memory to a buffer. Read more
Source§

unsafe fn create_buffer_view( &self, _: &Buffer, _: Option<Format>, _: SubRange, ) -> Result<(), ViewCreationError>

Create a new buffer view object
Source§

unsafe fn create_image( &self, kind: Kind, _: Level, _: Format, _: Tiling, _: Usage, _: SparseFlags, _: ViewCapabilities, ) -> Result<Image, CreationError>

Create a new image object
Source§

unsafe fn get_image_requirements(&self, image: &Image) -> Requirements

Get memory requirements for the Image
Source§

unsafe fn get_image_subresource_footprint( &self, _: &Image, _: Subresource, ) -> SubresourceFootprint

Source§

unsafe fn bind_image_memory( &self, _memory: &Memory, _: u64, _: &mut Image, ) -> Result<(), BindError>

Bind device memory to an image object
Source§

unsafe fn create_image_view( &self, _: &Image, _: ViewKind, _: Format, _: Swizzle, _: Usage, _: SubresourceRange, ) -> Result<(), ViewCreationError>

Create an image view from an existing image
Source§

unsafe fn create_descriptor_pool<I>( &self, _: usize, _: I, _: DescriptorPoolCreateFlags, ) -> Result<DescriptorPool, OutOfMemory>

Create a descriptor pool. Read more
Source§

unsafe fn create_descriptor_set_layout<'a, I, J>( &self, _bindings: I, _samplers: J, ) -> Result<DescriptorSetLayout, OutOfMemory>
where J: Iterator<Item = &'a ()>,

Create a descriptor set layout. Read more
Source§

unsafe fn write_descriptor_set<'a, I>( &self, _: DescriptorSetWrite<'a, Backend, I>, )
where I: Iterator<Item = Descriptor<'a, Backend>>,

Specifying the parameters of a descriptor set write operation.
Source§

unsafe fn copy_descriptor_set<'a>(&self, _: DescriptorSetCopy<'a, Backend>)

Structure specifying a copy descriptor set operation.
Source§

fn create_semaphore(&self) -> Result<(), OutOfMemory>

Create a new semaphore object.
Source§

fn create_fence(&self, _: bool) -> Result<(), OutOfMemory>

Create a new fence object. Read more
Source§

unsafe fn get_fence_status(&self, _: &()) -> Result<bool, DeviceLost>

true for signaled, false for not ready
Source§

fn create_event(&self) -> Result<(), OutOfMemory>

Create an event object.
Source§

unsafe fn get_event_status(&self, _: &()) -> Result<bool, WaitError>

Query the status of an event. Read more
Source§

unsafe fn set_event(&self, _: &mut ()) -> Result<(), OutOfMemory>

Sets an event.
Source§

unsafe fn reset_event(&self, _: &mut ()) -> Result<(), OutOfMemory>

Resets an event.
Source§

unsafe fn create_query_pool(&self, _: Type, _: u32) -> Result<(), CreationError>

Create a new query pool object Read more
Source§

unsafe fn destroy_query_pool(&self, _: ())

Destroy a query pool object
Source§

unsafe fn get_query_pool_results( &self, _: &(), _: Range<Id>, _: &mut [u8], _: Stride, _: ResultFlags, ) -> Result<bool, WaitError>

Get query pool results into the specified CPU memory. Returns Ok(false) if the results are not ready yet and neither of WAIT or PARTIAL flags are set.
Source§

unsafe fn map_memory( &self, memory: &mut Memory, segment: Segment, ) -> Result<*mut u8, MapError>

Map a memory object into application address space Read more
Source§

unsafe fn unmap_memory(&self, _memory: &mut Memory)

Unmap a memory object once host access to it is no longer needed by the application
Source§

unsafe fn flush_mapped_memory_ranges<'a, I>( &self, _: I, ) -> Result<(), OutOfMemory>
where I: Iterator<Item = (&'a Memory, Segment)>,

Flush mapped memory ranges
Source§

unsafe fn invalidate_mapped_memory_ranges<'a, I>( &self, _: I, ) -> Result<(), OutOfMemory>
where I: Iterator<Item = (&'a Memory, Segment)>,

Invalidate ranges of non-coherent memory from the host caches
Source§

unsafe fn free_memory(&self, _memory: Memory)

Free device memory
Source§

unsafe fn destroy_shader_module(&self, _: ())

Destroy a shader module module Read more
Source§

unsafe fn destroy_render_pass(&self, _: ())

Destroys a render pass created by this device.
Source§

unsafe fn destroy_pipeline_layout(&self, _: ())

Destroy a pipeline layout object
Source§

unsafe fn destroy_graphics_pipeline(&self, _: ())

Destroy a graphics pipeline. Read more
Source§

unsafe fn destroy_compute_pipeline(&self, _: ())

Destroy a compute pipeline. Read more
Source§

unsafe fn destroy_framebuffer(&self, _: ())

Destroy a framebuffer. Read more
Source§

unsafe fn destroy_buffer(&self, _: Buffer)

Destroy a buffer. Read more
Source§

unsafe fn destroy_buffer_view(&self, _: ())

Destroy a buffer view object
Source§

unsafe fn destroy_image(&self, _: Image)

Destroy an image. Read more
Source§

unsafe fn destroy_image_view(&self, _: ())

Destroy an image view object
Source§

unsafe fn destroy_sampler(&self, _: ())

Destroy a sampler object
Source§

unsafe fn destroy_descriptor_pool(&self, _: DescriptorPool)

Destroy a descriptor pool object Read more
Source§

unsafe fn destroy_descriptor_set_layout(&self, _: DescriptorSetLayout)

Destroy a descriptor set layout object
Source§

unsafe fn destroy_fence(&self, _: ())

Destroy a fence object
Source§

unsafe fn destroy_semaphore(&self, _: ())

Destroy a semaphore object.
Source§

unsafe fn destroy_event(&self, _: ())

Destroy an event object.
Source§

fn wait_idle(&self) -> Result<(), OutOfMemory>

Wait for all queues associated with this device to idle. Read more
Source§

unsafe fn set_image_name(&self, _: &mut Image, _: &str)

Associate a name with an image, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_buffer_name(&self, _: &mut Buffer, _: &str)

Associate a name with a buffer, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_command_buffer_name(&self, _: &mut CommandBuffer, _: &str)

Associate a name with a command buffer, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_semaphore_name(&self, _: &mut (), _: &str)

Associate a name with a semaphore, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_fence_name(&self, _: &mut (), _: &str)

Associate a name with a fence, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_framebuffer_name(&self, _: &mut (), _: &str)

Associate a name with a framebuffer, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_render_pass_name(&self, _: &mut (), _: &str)

Associate a name with a render pass, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_descriptor_set_name(&self, set: &mut DescriptorSet, name: &str)

Associate a name with a descriptor set, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_descriptor_set_layout_name( &self, layout: &mut DescriptorSetLayout, name: &str, )

Associate a name with a descriptor set layout, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn set_pipeline_layout_name( &self, _pipeline_layout: &mut (), _name: &str, )

Associate a name with a pipeline layout, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages
Source§

unsafe fn create_allocate_external_buffer( &self, _external_memory_type: ExternalBufferMemoryType, _usage: Usage, _sparse: SparseFlags, _type_mask: u32, _size: u64, ) -> Result<(<Backend as Backend>::Buffer, <Backend as Backend>::Memory), ExternalResourceError>

Create, allocate and bind a buffer that can be exported. Read more
Source§

unsafe fn import_external_buffer( &self, _external_memory: ExternalBufferMemory, _usage: Usage, _sparse: SparseFlags, _type_mask: u32, _size: u64, ) -> Result<(<Backend as Backend>::Buffer, <Backend as Backend>::Memory), ExternalResourceError>

Import external memory as binded buffer and memory. Read more
Source§

unsafe fn create_allocate_external_image( &self, _external_memory_type: ExternalImageMemoryType, _kind: Kind, _num_levels: Level, _format: Format, _tiling: Tiling, _usage: Usage, _sparse: SparseFlags, _view_caps: ViewCapabilities, _type_mask: u32, ) -> Result<(<Backend as Backend>::Image, <Backend as Backend>::Memory), ExternalResourceError>

Create, allocate and bind an image that can be exported. Read more
Source§

unsafe fn import_external_image( &self, _external_memory: ExternalImageMemory, _kind: Kind, _num_levels: Level, _format: Format, _tiling: Tiling, _usage: Usage, _sparse: SparseFlags, _view_caps: ViewCapabilities, _type_mask: u32, ) -> Result<(<Backend as Backend>::Image, <Backend as Backend>::Memory), ExternalResourceError>

Import external memory as binded image and memory. Read more
Source§

unsafe fn export_memory( &self, _external_memory_type: ExternalMemoryType, _memory: &<Backend as Backend>::Memory, ) -> Result<PlatformMemory, ExternalMemoryExportError>

Export memory as os type (Fd, Handle or Ptr) based on the requested external memory type. Read more
Source§

unsafe fn drm_format_modifier( &self, _image: &<Backend as Backend>::Image, ) -> Option<DrmModifier>

Retrieve the underlying drm format modifier from an image, if any. Read more
Source§

unsafe fn reset_fence(&self, _: &mut ()) -> Result<(), OutOfMemory>

Resets a given fence to its original, unsignaled state.
Source§

unsafe fn wait_for_fence(&self, _: &(), _: u64) -> Result<bool, WaitError>

Blocks until the given fence is signaled. Returns true if the fence was signaled before the timeout.
Source§

unsafe fn set_display_power_state( &self, _display: &Display<Backend>, _power_state: &PowerState, ) -> Result<(), DisplayControlError>

Control the power state of the provided display
Source§

unsafe fn register_device_event( &self, _device_event: &DeviceEvent, _fence: &mut <Backend as Backend>::Fence, ) -> Result<(), DisplayControlError>

Register device event
Source§

unsafe fn register_display_event( &self, _display: &Display<Backend>, _display_event: &DisplayEvent, _fence: &mut <Backend as Backend>::Fence, ) -> Result<(), DisplayControlError>

Register display event
Source§

fn start_capture(&self)

Starts frame capture.
Source§

fn stop_capture(&self)

Stops frame capture.
Source§

unsafe fn create_shader_module_from_naga( &self, shader: NagaShader, ) -> Result<<B as Backend>::ShaderModule, (ShaderError, NagaShader)>

Create a new shader module from the naga module.
Source§

unsafe fn wait_for_fences<'a, I>( &self, fences: I, wait: WaitFor, timeout_ns: u64, ) -> Result<bool, WaitError>
where I: Iterator<Item = &'a <B as Backend>::Fence>,

Blocks until all or one of the given fences are signaled. Returns true if fences were signaled before the timeout.

Auto Trait Implementations§

§

impl Freeze for Device

§

impl RefUnwindSafe for Device

§

impl Send for Device

§

impl Sync for Device

§

impl Unpin for Device

§

impl UnwindSafe for Device

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.