[−][src]Struct gfx_backend_vulkan::Device
pub struct Device { /* fields omitted */ }
Trait Implementations
impl Debug for Device
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl Device<Backend> for Device
[src][+]
unsafe fn allocate_memory(
&self,
mem_type: MemoryTypeId,
size: u64
) -> Result<Memory, AllocationError>
[src][−]
&self,
mem_type: MemoryTypeId,
size: u64
) -> Result<Memory, AllocationError>
Allocates a memory segment of a specified type. Read more
unsafe fn create_command_pool(
&self,
family: QueueFamilyId,
create_flags: CommandPoolCreateFlags
) -> Result<RawCommandPool, OutOfMemory>
[src][−]
&self,
family: QueueFamilyId,
create_flags: CommandPoolCreateFlags
) -> Result<RawCommandPool, OutOfMemory>
Create a new command pool for a given queue family. Read more
unsafe fn destroy_command_pool(&self, pool: RawCommandPool)
[src][−]
Destroy a command pool.
unsafe fn create_render_pass<'a, IA, IS, ID>(
&self,
attachments: IA,
subpasses: IS,
dependencies: ID
) -> Result<RenderPass, OutOfMemory> where
IA: IntoIterator,
IA::Item: Borrow<Attachment>,
IA::IntoIter: ExactSizeIterator,
IS: IntoIterator,
IS::Item: Borrow<SubpassDesc<'a>>,
IS::IntoIter: ExactSizeIterator,
ID: IntoIterator,
ID::Item: Borrow<SubpassDependency>,
ID::IntoIter: ExactSizeIterator,
[src][−]
&self,
attachments: IA,
subpasses: IS,
dependencies: ID
) -> Result<RenderPass, OutOfMemory> where
IA: IntoIterator,
IA::Item: Borrow<Attachment>,
IA::IntoIter: ExactSizeIterator,
IS: IntoIterator,
IS::Item: Borrow<SubpassDesc<'a>>,
IS::IntoIter: ExactSizeIterator,
ID: IntoIterator,
ID::Item: Borrow<SubpassDependency>,
ID::IntoIter: ExactSizeIterator,
Create a render pass with the given attachments and subpasses. Read more
unsafe fn create_pipeline_layout<IS, IR>(
&self,
sets: IS,
push_constant_ranges: IR
) -> Result<PipelineLayout, OutOfMemory> where
IS: IntoIterator,
IS::Item: Borrow<DescriptorSetLayout>,
IS::IntoIter: ExactSizeIterator,
IR: IntoIterator,
IR::Item: Borrow<(ShaderStageFlags, Range<u32>)>,
IR::IntoIter: ExactSizeIterator,
[src][−]
&self,
sets: IS,
push_constant_ranges: IR
) -> Result<PipelineLayout, OutOfMemory> where
IS: IntoIterator,
IS::Item: Borrow<DescriptorSetLayout>,
IS::IntoIter: ExactSizeIterator,
IR: IntoIterator,
IR::Item: Borrow<(ShaderStageFlags, Range<u32>)>,
IR::IntoIter: ExactSizeIterator,
Create a new pipeline layout object. Read more
unsafe fn create_pipeline_cache(
&self,
data: Option<&[u8]>
) -> Result<PipelineCache, OutOfMemory>
[src][−]
&self,
data: Option<&[u8]>
) -> Result<PipelineCache, OutOfMemory>
Create a pipeline cache object.
unsafe fn get_pipeline_cache_data(
&self,
cache: &PipelineCache
) -> Result<Vec<u8>, OutOfMemory>
[src][−]
&self,
cache: &PipelineCache
) -> Result<Vec<u8>, OutOfMemory>
Retrieve data from pipeline cache object.
unsafe fn destroy_pipeline_cache(&self, cache: PipelineCache)
[src][−]
Destroy a pipeline cache object.
unsafe fn merge_pipeline_caches<I>(
&self,
target: &PipelineCache,
sources: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<PipelineCache>,
I::IntoIter: ExactSizeIterator,
[src][−]
&self,
target: &PipelineCache,
sources: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<PipelineCache>,
I::IntoIter: ExactSizeIterator,
Merge a number of source pipeline caches into the target one.
unsafe fn create_graphics_pipeline<'a>(
&self,
desc: &GraphicsPipelineDesc<'a, B>,
cache: Option<&PipelineCache>
) -> Result<GraphicsPipeline, CreationError>
[src][−]
&self,
desc: &GraphicsPipelineDesc<'a, B>,
cache: Option<&PipelineCache>
) -> Result<GraphicsPipeline, CreationError>
Create a graphics pipeline. Read more
unsafe fn create_graphics_pipelines<'a, T>(
&self,
descs: T,
cache: Option<&PipelineCache>
) -> Vec<Result<GraphicsPipeline, CreationError>> where
T: IntoIterator,
T::Item: Borrow<GraphicsPipelineDesc<'a, B>>,
[src][−]
&self,
descs: T,
cache: Option<&PipelineCache>
) -> Vec<Result<GraphicsPipeline, CreationError>> where
T: IntoIterator,
T::Item: Borrow<GraphicsPipelineDesc<'a, B>>,
Create multiple graphics pipelines.
unsafe fn create_compute_pipeline<'a>(
&self,
desc: &ComputePipelineDesc<'a, B>,
cache: Option<&PipelineCache>
) -> Result<ComputePipeline, CreationError>
[src][−]
&self,
desc: &ComputePipelineDesc<'a, B>,
cache: Option<&PipelineCache>
) -> Result<ComputePipeline, CreationError>
Create a compute pipeline.
unsafe fn create_compute_pipelines<'a, T>(
&self,
descs: T,
cache: Option<&PipelineCache>
) -> Vec<Result<ComputePipeline, CreationError>> where
T: IntoIterator,
T::Item: Borrow<ComputePipelineDesc<'a, B>>,
[src][−]
&self,
descs: T,
cache: Option<&PipelineCache>
) -> Vec<Result<ComputePipeline, CreationError>> where
T: IntoIterator,
T::Item: Borrow<ComputePipelineDesc<'a, B>>,
Create compute pipelines.
unsafe fn create_framebuffer<T>(
&self,
renderpass: &RenderPass,
attachments: T,
extent: Extent
) -> Result<Framebuffer, OutOfMemory> where
T: IntoIterator,
T::Item: Borrow<ImageView>,
[src][−]
&self,
renderpass: &RenderPass,
attachments: T,
extent: Extent
) -> Result<Framebuffer, OutOfMemory> where
T: IntoIterator,
T::Item: Borrow<ImageView>,
Create a new framebuffer object. Read more
unsafe fn create_shader_module(
&self,
spirv_data: &[u32]
) -> Result<ShaderModule, ShaderError>
[src][−]
&self,
spirv_data: &[u32]
) -> Result<ShaderModule, ShaderError>
Create a new shader module object from the SPIR-V binary data. Read more
unsafe fn create_sampler(
&self,
desc: &SamplerDesc
) -> Result<Sampler, AllocationError>
[src][−]
&self,
desc: &SamplerDesc
) -> Result<Sampler, AllocationError>
Create a new sampler object
unsafe fn create_buffer(
&self,
size: u64,
usage: Usage
) -> Result<Buffer, CreationError>
[src][−]
&self,
size: u64,
usage: Usage
) -> Result<Buffer, CreationError>
unsafe fn get_buffer_requirements(&self, buffer: &Buffer) -> Requirements
[src][−]
Get memory requirements for the buffer
unsafe fn bind_buffer_memory(
&self,
memory: &Memory,
offset: u64,
buffer: &mut Buffer
) -> Result<(), BindError>
[src][−]
&self,
memory: &Memory,
offset: u64,
buffer: &mut Buffer
) -> Result<(), BindError>
Bind memory to a buffer. Read more
unsafe fn create_buffer_view(
&self,
buffer: &Buffer,
format: Option<Format>,
range: SubRange
) -> Result<BufferView, ViewCreationError>
[src][−]
&self,
buffer: &Buffer,
format: Option<Format>,
range: SubRange
) -> Result<BufferView, ViewCreationError>
Create a new buffer view object
unsafe fn create_image(
&self,
kind: Kind,
mip_levels: Level,
format: Format,
tiling: Tiling,
usage: Usage,
view_caps: ViewCapabilities
) -> Result<Image, CreationError>
[src][−]
&self,
kind: Kind,
mip_levels: Level,
format: Format,
tiling: Tiling,
usage: Usage,
view_caps: ViewCapabilities
) -> Result<Image, CreationError>
Create a new image object
unsafe fn get_image_requirements(&self, image: &Image) -> Requirements
[src][−]
Get memory requirements for the Image
unsafe fn get_image_subresource_footprint(
&self,
image: &Image,
subresource: Subresource
) -> SubresourceFootprint
[src][−]
&self,
image: &Image,
subresource: Subresource
) -> SubresourceFootprint
unsafe fn bind_image_memory(
&self,
memory: &Memory,
offset: u64,
image: &mut Image
) -> Result<(), BindError>
[src][−]
&self,
memory: &Memory,
offset: u64,
image: &mut Image
) -> Result<(), BindError>
Bind device memory to an image object
unsafe fn create_image_view(
&self,
image: &Image,
kind: ViewKind,
format: Format,
swizzle: Swizzle,
range: SubresourceRange
) -> Result<ImageView, ViewCreationError>
[src][−]
&self,
image: &Image,
kind: ViewKind,
format: Format,
swizzle: Swizzle,
range: SubresourceRange
) -> Result<ImageView, ViewCreationError>
Create an image view from an existing image
unsafe fn create_descriptor_pool<T>(
&self,
max_sets: usize,
descriptor_pools: T,
flags: DescriptorPoolCreateFlags
) -> Result<DescriptorPool, OutOfMemory> where
T: IntoIterator,
T::Item: Borrow<DescriptorRangeDesc>,
T::IntoIter: ExactSizeIterator,
[src][−]
&self,
max_sets: usize,
descriptor_pools: T,
flags: DescriptorPoolCreateFlags
) -> Result<DescriptorPool, OutOfMemory> where
T: IntoIterator,
T::Item: Borrow<DescriptorRangeDesc>,
T::IntoIter: ExactSizeIterator,
Create a descriptor pool. Read more
unsafe fn create_descriptor_set_layout<I, J>(
&self,
binding_iter: I,
immutable_sampler_iter: J
) -> Result<DescriptorSetLayout, OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<DescriptorSetLayoutBinding>,
J: IntoIterator,
J::Item: Borrow<Sampler>,
J::IntoIter: ExactSizeIterator,
[src][−]
&self,
binding_iter: I,
immutable_sampler_iter: J
) -> Result<DescriptorSetLayout, OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<DescriptorSetLayoutBinding>,
J: IntoIterator,
J::Item: Borrow<Sampler>,
J::IntoIter: ExactSizeIterator,
Create a descriptor set layout. Read more
unsafe fn write_descriptor_sets<'a, I, J>(&self, write_iter: I) where
I: IntoIterator<Item = DescriptorSetWrite<'a, B, J>>,
J: IntoIterator,
J::Item: Borrow<Descriptor<'a, B>>,
[src][−]
I: IntoIterator<Item = DescriptorSetWrite<'a, B, J>>,
J: IntoIterator,
J::Item: Borrow<Descriptor<'a, B>>,
Specifying the parameters of a descriptor set write operation
unsafe fn copy_descriptor_sets<'a, I>(&self, copies: I) where
I: IntoIterator,
I::Item: Borrow<DescriptorSetCopy<'a, B>>,
I::IntoIter: ExactSizeIterator,
[src][−]
I: IntoIterator,
I::Item: Borrow<DescriptorSetCopy<'a, B>>,
I::IntoIter: ExactSizeIterator,
Structure specifying a copy descriptor set operation
unsafe fn map_memory(
&self,
memory: &Memory,
segment: Segment
) -> Result<*mut u8, MapError>
[src][−]
&self,
memory: &Memory,
segment: Segment
) -> Result<*mut u8, MapError>
Map a memory object into application address space Read more
unsafe fn unmap_memory(&self, memory: &Memory)
[src][−]
Unmap a memory object once host access to it is no longer needed by the application
unsafe fn flush_mapped_memory_ranges<'a, I>(
&self,
ranges: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<(&'a Memory, Segment)>,
[src][−]
&self,
ranges: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<(&'a Memory, Segment)>,
Flush mapped memory ranges
unsafe fn invalidate_mapped_memory_ranges<'a, I>(
&self,
ranges: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<(&'a Memory, Segment)>,
[src][−]
&self,
ranges: I
) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<(&'a Memory, Segment)>,
Invalidate ranges of non-coherent memory from the host caches
fn create_semaphore(&self) -> Result<Semaphore, OutOfMemory>
[src][−]
Create a new semaphore object.
fn create_fence(&self, signaled: bool) -> Result<Fence, OutOfMemory>
[src][−]
Create a new fence object. Read more
unsafe fn reset_fences<I>(&self, fences: I) -> Result<(), OutOfMemory> where
I: IntoIterator,
I::Item: Borrow<Fence>,
I::IntoIter: ExactSizeIterator,
[src][−]
I: IntoIterator,
I::Item: Borrow<Fence>,
I::IntoIter: ExactSizeIterator,
Resets multiple fences to their original states.
unsafe fn wait_for_fences<I>(
&self,
fences: I,
wait: WaitFor,
timeout_ns: u64
) -> Result<bool, OomOrDeviceLost> where
I: IntoIterator,
I::Item: Borrow<Fence>,
I::IntoIter: ExactSizeIterator,
[src][−]
&self,
fences: I,
wait: WaitFor,
timeout_ns: u64
) -> Result<bool, OomOrDeviceLost> where
I: IntoIterator,
I::Item: Borrow<Fence>,
I::IntoIter: ExactSizeIterator,
Blocks until all or one of the given fences are signaled. Returns true if fences were signaled before the timeout. Read more
unsafe fn get_fence_status(&self, fence: &Fence) -> Result<bool, DeviceLost>
[src][−]
true for signaled, false for not ready
fn create_event(&self) -> Result<Event, OutOfMemory>
[src][−]
Create an event object.
unsafe fn get_event_status(
&self,
event: &Event
) -> Result<bool, OomOrDeviceLost>
[src][−]
&self,
event: &Event
) -> Result<bool, OomOrDeviceLost>
Query the status of an event. Read more
unsafe fn set_event(&self, event: &Event) -> Result<(), OutOfMemory>
[src][−]
Sets an event.
unsafe fn reset_event(&self, event: &Event) -> Result<(), OutOfMemory>
[src][−]
Resets an event.
unsafe fn free_memory(&self, memory: Memory)
[src][−]
Free device memory
unsafe fn create_query_pool(
&self,
ty: Type,
query_count: Id
) -> Result<QueryPool, CreationError>
[src][−]
&self,
ty: Type,
query_count: Id
) -> Result<QueryPool, CreationError>
Create a new query pool object Read more
unsafe fn get_query_pool_results(
&self,
pool: &QueryPool,
queries: Range<Id>,
data: &mut [u8],
stride: Offset,
flags: ResultFlags
) -> Result<bool, OomOrDeviceLost>
[src][−]
&self,
pool: &QueryPool,
queries: Range<Id>,
data: &mut [u8],
stride: Offset,
flags: ResultFlags
) -> Result<bool, OomOrDeviceLost>
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. Read more
unsafe fn destroy_query_pool(&self, pool: QueryPool)
[src][−]
Destroy a query pool object
unsafe fn destroy_shader_module(&self, module: ShaderModule)
[src][−]
Destroy a shader module module Read more
unsafe fn destroy_render_pass(&self, rp: RenderPass)
[src][−]
Destroys a render pass created by this device.
unsafe fn destroy_pipeline_layout(&self, pl: PipelineLayout)
[src][−]
Destroy a pipeline layout object
unsafe fn destroy_graphics_pipeline(&self, pipeline: GraphicsPipeline)
[src][−]
Destroy a graphics pipeline. Read more
unsafe fn destroy_compute_pipeline(&self, pipeline: ComputePipeline)
[src][−]
Destroy a compute pipeline. Read more
unsafe fn destroy_framebuffer(&self, fb: Framebuffer)
[src][−]
Destroy a framebuffer. Read more
unsafe fn destroy_buffer(&self, buffer: Buffer)
[src][−]
Destroy a buffer. Read more
unsafe fn destroy_buffer_view(&self, view: BufferView)
[src][−]
Destroy a buffer view object
unsafe fn destroy_image(&self, image: Image)
[src][−]
Destroy an image. Read more
unsafe fn destroy_image_view(&self, view: ImageView)
[src][−]
Destroy an image view object
unsafe fn destroy_sampler(&self, sampler: Sampler)
[src][−]
Destroy a sampler object
unsafe fn destroy_descriptor_pool(&self, pool: DescriptorPool)
[src][−]
Destroy a descriptor pool object Read more
unsafe fn destroy_descriptor_set_layout(&self, layout: DescriptorSetLayout)
[src][−]
Destroy a descriptor set layout object
unsafe fn destroy_fence(&self, fence: Fence)
[src][−]
Destroy a fence object
unsafe fn destroy_semaphore(&self, semaphore: Semaphore)
[src][−]
Destroy a semaphore object.
unsafe fn destroy_event(&self, event: Event)
[src][−]
Destroy an event object.
fn wait_idle(&self) -> Result<(), OutOfMemory>
[src][−]
Wait for all queues associated with this device to idle. Read more
unsafe fn set_image_name(&self, image: &mut Image, name: &str)
[src][−]
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 Read more
unsafe fn set_buffer_name(&self, buffer: &mut Buffer, name: &str)
[src][−]
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 Read more
unsafe fn set_command_buffer_name(
&self,
command_buffer: &mut CommandBuffer,
name: &str
)
[src][−]
&self,
command_buffer: &mut CommandBuffer,
name: &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 Read more
unsafe fn set_semaphore_name(&self, semaphore: &mut Semaphore, name: &str)
[src][−]
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 Read more
unsafe fn set_fence_name(&self, fence: &mut Fence, name: &str)
[src][−]
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 Read more
unsafe fn set_framebuffer_name(&self, framebuffer: &mut Framebuffer, name: &str)
[src][−]
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 Read more
unsafe fn set_render_pass_name(&self, render_pass: &mut RenderPass, name: &str)
[src][−]
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 Read more
unsafe fn set_descriptor_set_name(
&self,
descriptor_set: &mut DescriptorSet,
name: &str
)
[src][−]
&self,
descriptor_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 Read more
unsafe fn set_descriptor_set_layout_name(
&self,
descriptor_set_layout: &mut DescriptorSetLayout,
name: &str
)
[src][−]
&self,
descriptor_set_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 Read more
unsafe fn set_pipeline_layout_name(
&self,
pipeline_layout: &mut PipelineLayout,
name: &str
)
[src][−]
&self,
pipeline_layout: &mut PipelineLayout,
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 Read more
unsafe fn set_compute_pipeline_name(
&self,
compute_pipeline: &mut ComputePipeline,
name: &str
)
[src][−]
&self,
compute_pipeline: &mut ComputePipeline,
name: &str
)
Associate a name with a compute pipeline, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages Read more
unsafe fn set_graphics_pipeline_name(
&self,
graphics_pipeline: &mut GraphicsPipeline,
name: &str
)
[src][−]
&self,
graphics_pipeline: &mut GraphicsPipeline,
name: &str
)
Associate a name with a graphics pipeline, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages Read more
unsafe fn reset_fence(
&self,
fence: &<B as Backend>::Fence
) -> Result<(), OutOfMemory>
[src][−]
&self,
fence: &<B as Backend>::Fence
) -> Result<(), OutOfMemory>
Resets a given fence to its original, unsignaled state.
unsafe fn wait_for_fence(
&self,
fence: &<B as Backend>::Fence,
timeout_ns: u64
) -> Result<bool, OomOrDeviceLost>
[src][−]
&self,
fence: &<B as Backend>::Fence,
timeout_ns: u64
) -> Result<bool, OomOrDeviceLost>
Blocks until the given fence is signaled. Returns true if the fence was signaled before the timeout. Read more
Auto Trait Implementations
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
[src][−]
Gets the TypeId
of self
. Read more
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
fn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
Performs the conversion.
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,