Struct sierra::backend::Device [−][src]
#[repr(transparent)]pub struct Device { /* fields omitted */ }
Expand description
Opaque value that represents graphics API device. It is used to manage (create, destroy, check state) most of the device resources.
Implementations
Returns graphics associated with the device instance.
Returns weak reference to this device.
Creates buffer with uninitialized content.
pub fn create_mappable_buffer(
&self,
info: BufferInfo,
memory_usage: MemoryUsage
) -> Result<MappableBuffer, OutOfMemory>
pub fn create_mappable_buffer(
&self,
info: BufferInfo,
memory_usage: MemoryUsage
) -> Result<MappableBuffer, OutOfMemory>
Creates buffer with uninitialized content.
pub fn create_buffer_static<T: 'static>(
&self,
info: BufferInfo,
data: &[T]
) -> Result<Buffer, OutOfMemory> where
T: Pod,
pub fn create_buffer_static<T: 'static>(
&self,
info: BufferInfo,
data: &[T]
) -> Result<Buffer, OutOfMemory> where
T: Pod,
Creates static buffer with preinitialized content from data
.
Implies MemoryUsage::Device
.
Panics
Function will panic if creating buffer size does not equal data size.
E.g. if info.size != std::mem::size_of(data)
.
Creates a fence. Fences are create in unsignaled state.
Creates framebuffer for specified render pass from views.
pub fn create_graphics_pipeline(
&self,
info: GraphicsPipelineInfo
) -> Result<GraphicsPipeline, OutOfMemory>
pub fn create_graphics_pipeline(
&self,
info: GraphicsPipelineInfo
) -> Result<GraphicsPipeline, OutOfMemory>
Creates graphics pipeline.
pub fn create_compute_pipeline(
&self,
info: ComputePipelineInfo
) -> Result<ComputePipeline, OutOfMemory>
pub fn create_compute_pipeline(
&self,
info: ComputePipelineInfo
) -> Result<ComputePipeline, OutOfMemory>
Creates compute pipeline.
Creates image with uninitialized content.
Creates view to an image.
pub fn create_pipeline_layout(
&self,
info: PipelineLayoutInfo
) -> Result<PipelineLayout, OutOfMemory>
pub fn create_pipeline_layout(
&self,
info: PipelineLayoutInfo
) -> Result<PipelineLayout, OutOfMemory>
Creates pipeline layout.
pub fn create_render_pass(
&self,
info: RenderPassInfo
) -> Result<RenderPass, CreateRenderPassError>
pub fn create_render_pass(
&self,
info: RenderPassInfo
) -> Result<RenderPass, CreateRenderPassError>
Creates render pass.
Creates semaphore. Semaphores are created in unsignaled state.
pub fn create_shader_module(
&self,
info: ShaderModuleInfo
) -> Result<ShaderModule, CreateShaderModuleError>
pub fn create_shader_module(
&self,
info: ShaderModuleInfo
) -> Result<ShaderModule, CreateShaderModuleError>
Creates new shader module from shader’s code.
Creates swapchain for specified surface. Only one swapchain may be associated with one surface.
Resets fences. All specified fences must be in signalled state. Fences are moved into unsignalled state.
Checks if fence is in signalled state.
Wait for fences to become signaled.
If all
is true
- waits for all specified fences to become signaled.
Otherwise waits for at least on of specified fences to become signaled.
May return immediately if all fences are already signaled (or at least
one is signaled if all == false
). Fences are signaled by Queue
s.
See Queue::submit
.
Wait for whole device to become idle. That is, wait for all pending
operations to complete. This is equivalent to calling
Queue::wait_idle
for all queues. Typically used only before device
destruction.
pub fn get_acceleration_structure_build_sizes(
&self,
level: AccelerationStructureLevel,
flags: AccelerationStructureBuildFlags,
geometry: &[AccelerationStructureGeometryInfo]
) -> AccelerationStructureBuildSizesInfo
pub fn get_acceleration_structure_build_sizes(
&self,
level: AccelerationStructureLevel,
flags: AccelerationStructureBuildFlags,
geometry: &[AccelerationStructureGeometryInfo]
) -> AccelerationStructureBuildSizesInfo
Returns memory size requirements for accelelration structure build operations.
pub fn create_acceleration_structure(
&self,
info: AccelerationStructureInfo
) -> Result<AccelerationStructure, OutOfMemory>
pub fn create_acceleration_structure(
&self,
info: AccelerationStructureInfo
) -> Result<AccelerationStructure, OutOfMemory>
Returns buffers device address.
pub fn get_acceleration_structure_device_address(
&self,
acceleration_structure: &AccelerationStructure
) -> DeviceAddress
pub fn get_acceleration_structure_device_address(
&self,
acceleration_structure: &AccelerationStructure
) -> DeviceAddress
Returns device address of acceleration strucutre.
pub fn create_ray_tracing_pipeline(
&self,
info: RayTracingPipelineInfo
) -> Result<RayTracingPipeline, OutOfMemory>
pub fn create_ray_tracing_pipeline(
&self,
info: RayTracingPipelineInfo
) -> Result<RayTracingPipeline, OutOfMemory>
Creates ray-tracing pipeline.
pub fn create_descriptor_set_layout(
&self,
info: DescriptorSetLayoutInfo
) -> Result<DescriptorSetLayout, OutOfMemory>
pub fn create_descriptor_set(
&self,
info: DescriptorSetInfo
) -> Result<DescriptorSet, DescriptorsAllocationError>
pub fn update_descriptor_sets<'a>(
&self,
writes: &[WriteDescriptorSet<'a>],
copies: &[CopyDescriptorSet<'a>]
)
pub fn create_shader_binding_table(
&self,
pipeline: &RayTracingPipeline,
info: ShaderBindingTableInfo<'_>
) -> Result<ShaderBindingTable, OutOfMemory>
pub fn map_memory(
&self,
buffer: &mut MappableBuffer,
offset: u64,
size: usize
) -> Result<&mut [MaybeUninit<u8>], MapError>
pub fn write_buffer<T>(
&self,
buffer: &mut MappableBuffer,
offset: u64,
data: &[T]
) -> Result<(), MapError> where
T: Pod,
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Device
impl !UnwindSafe for Device
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more