Trait wgpu_hal::DynDevice

source ·
pub trait DynDevice: DynResource {
Show 46 methods // Required methods unsafe fn create_buffer( &self, desc: &BufferDescriptor<'_>, ) -> Result<Box<dyn DynBuffer>, DeviceError>; unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>); unsafe fn add_raw_buffer(&self, buffer: &dyn DynBuffer); unsafe fn map_buffer( &self, buffer: &dyn DynBuffer, range: MemoryRange, ) -> Result<BufferMapping, DeviceError>; unsafe fn unmap_buffer(&self, buffer: &dyn DynBuffer); unsafe fn flush_mapped_ranges( &self, buffer: &dyn DynBuffer, ranges: &[MemoryRange], ); unsafe fn invalidate_mapped_ranges( &self, buffer: &dyn DynBuffer, ranges: &[MemoryRange], ); unsafe fn create_texture( &self, desc: &TextureDescriptor<'_>, ) -> Result<Box<dyn DynTexture>, DeviceError>; unsafe fn destroy_texture(&self, texture: Box<dyn DynTexture>); unsafe fn add_raw_texture(&self, texture: &dyn DynTexture); unsafe fn create_texture_view( &self, texture: &dyn DynTexture, desc: &TextureViewDescriptor<'_>, ) -> Result<Box<dyn DynTextureView>, DeviceError>; unsafe fn destroy_texture_view(&self, view: Box<dyn DynTextureView>); unsafe fn create_sampler( &self, desc: &SamplerDescriptor<'_>, ) -> Result<Box<dyn DynSampler>, DeviceError>; unsafe fn destroy_sampler(&self, sampler: Box<dyn DynSampler>); unsafe fn create_command_encoder( &self, desc: &CommandEncoderDescriptor<'_, dyn DynQueue>, ) -> Result<Box<dyn DynCommandEncoder>, DeviceError>; unsafe fn create_bind_group_layout( &self, desc: &BindGroupLayoutDescriptor<'_>, ) -> Result<Box<dyn DynBindGroupLayout>, DeviceError>; unsafe fn destroy_bind_group_layout( &self, bg_layout: Box<dyn DynBindGroupLayout>, ); unsafe fn create_pipeline_layout( &self, desc: &PipelineLayoutDescriptor<'_, dyn DynBindGroupLayout>, ) -> Result<Box<dyn DynPipelineLayout>, DeviceError>; unsafe fn destroy_pipeline_layout( &self, pipeline_layout: Box<dyn DynPipelineLayout>, ); unsafe fn create_bind_group( &self, desc: &BindGroupDescriptor<'_, dyn DynBindGroupLayout, dyn DynBuffer, dyn DynSampler, dyn DynTextureView, dyn DynAccelerationStructure>, ) -> Result<Box<dyn DynBindGroup>, DeviceError>; unsafe fn destroy_bind_group(&self, group: Box<dyn DynBindGroup>); unsafe fn create_shader_module( &self, desc: &ShaderModuleDescriptor<'_>, shader: ShaderInput<'_>, ) -> Result<Box<dyn DynShaderModule>, ShaderError>; unsafe fn destroy_shader_module(&self, module: Box<dyn DynShaderModule>); unsafe fn create_render_pipeline( &self, desc: &RenderPipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynRenderPipeline>, PipelineError>; unsafe fn destroy_render_pipeline( &self, pipeline: Box<dyn DynRenderPipeline>, ); unsafe fn create_compute_pipeline( &self, desc: &ComputePipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynComputePipeline>, PipelineError>; unsafe fn destroy_compute_pipeline( &self, pipeline: Box<dyn DynComputePipeline>, ); unsafe fn create_pipeline_cache( &self, desc: &PipelineCacheDescriptor<'_>, ) -> Result<Box<dyn DynPipelineCache>, PipelineCacheError>; unsafe fn destroy_pipeline_cache(&self, cache: Box<dyn DynPipelineCache>); unsafe fn create_query_set( &self, desc: &QuerySetDescriptor<Label<'_>>, ) -> Result<Box<dyn DynQuerySet>, DeviceError>; unsafe fn destroy_query_set(&self, set: Box<dyn DynQuerySet>); unsafe fn create_fence(&self) -> Result<Box<dyn DynFence>, DeviceError>; unsafe fn destroy_fence(&self, fence: Box<dyn DynFence>); unsafe fn get_fence_value( &self, fence: &dyn DynFence, ) -> Result<FenceValue, DeviceError>; unsafe fn wait( &self, fence: &dyn DynFence, value: FenceValue, timeout_ms: u32, ) -> Result<bool, DeviceError>; unsafe fn start_capture(&self) -> bool; unsafe fn stop_capture(&self); unsafe fn pipeline_cache_get_data( &self, cache: &dyn DynPipelineCache, ) -> Option<Vec<u8>>; unsafe fn create_acceleration_structure( &self, desc: &AccelerationStructureDescriptor<'_>, ) -> Result<Box<dyn DynAccelerationStructure>, DeviceError>; unsafe fn get_acceleration_structure_build_sizes( &self, desc: &GetAccelerationStructureBuildSizesDescriptor<'_, dyn DynBuffer>, ) -> AccelerationStructureBuildSizes; unsafe fn get_acceleration_structure_device_address( &self, acceleration_structure: &dyn DynAccelerationStructure, ) -> BufferAddress; unsafe fn destroy_acceleration_structure( &self, acceleration_structure: Box<dyn DynAccelerationStructure>, ); fn tlas_instance_to_bytes(&self, instance: TlasInstance) -> Vec<u8>; fn get_internal_counters(&self) -> HalCounters; fn generate_allocator_report(&self) -> Option<AllocatorReport>; // Provided method fn pipeline_cache_validation_key(&self) -> Option<[u8; 16]> { ... }
}

Required Methods§

source

unsafe fn create_buffer( &self, desc: &BufferDescriptor<'_>, ) -> Result<Box<dyn DynBuffer>, DeviceError>

source

unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>)

source

unsafe fn add_raw_buffer(&self, buffer: &dyn DynBuffer)

source

unsafe fn map_buffer( &self, buffer: &dyn DynBuffer, range: MemoryRange, ) -> Result<BufferMapping, DeviceError>

source

unsafe fn unmap_buffer(&self, buffer: &dyn DynBuffer)

source

unsafe fn flush_mapped_ranges( &self, buffer: &dyn DynBuffer, ranges: &[MemoryRange], )

source

unsafe fn invalidate_mapped_ranges( &self, buffer: &dyn DynBuffer, ranges: &[MemoryRange], )

source

unsafe fn create_texture( &self, desc: &TextureDescriptor<'_>, ) -> Result<Box<dyn DynTexture>, DeviceError>

source

unsafe fn destroy_texture(&self, texture: Box<dyn DynTexture>)

source

unsafe fn add_raw_texture(&self, texture: &dyn DynTexture)

source

unsafe fn create_texture_view( &self, texture: &dyn DynTexture, desc: &TextureViewDescriptor<'_>, ) -> Result<Box<dyn DynTextureView>, DeviceError>

source

unsafe fn destroy_texture_view(&self, view: Box<dyn DynTextureView>)

source

unsafe fn create_sampler( &self, desc: &SamplerDescriptor<'_>, ) -> Result<Box<dyn DynSampler>, DeviceError>

source

unsafe fn destroy_sampler(&self, sampler: Box<dyn DynSampler>)

source

unsafe fn create_command_encoder( &self, desc: &CommandEncoderDescriptor<'_, dyn DynQueue>, ) -> Result<Box<dyn DynCommandEncoder>, DeviceError>

source

unsafe fn create_bind_group_layout( &self, desc: &BindGroupLayoutDescriptor<'_>, ) -> Result<Box<dyn DynBindGroupLayout>, DeviceError>

source

unsafe fn destroy_bind_group_layout( &self, bg_layout: Box<dyn DynBindGroupLayout>, )

source

unsafe fn create_pipeline_layout( &self, desc: &PipelineLayoutDescriptor<'_, dyn DynBindGroupLayout>, ) -> Result<Box<dyn DynPipelineLayout>, DeviceError>

source

unsafe fn destroy_pipeline_layout( &self, pipeline_layout: Box<dyn DynPipelineLayout>, )

source

unsafe fn create_bind_group( &self, desc: &BindGroupDescriptor<'_, dyn DynBindGroupLayout, dyn DynBuffer, dyn DynSampler, dyn DynTextureView, dyn DynAccelerationStructure>, ) -> Result<Box<dyn DynBindGroup>, DeviceError>

source

unsafe fn destroy_bind_group(&self, group: Box<dyn DynBindGroup>)

source

unsafe fn create_shader_module( &self, desc: &ShaderModuleDescriptor<'_>, shader: ShaderInput<'_>, ) -> Result<Box<dyn DynShaderModule>, ShaderError>

source

unsafe fn destroy_shader_module(&self, module: Box<dyn DynShaderModule>)

source

unsafe fn create_render_pipeline( &self, desc: &RenderPipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynRenderPipeline>, PipelineError>

source

unsafe fn destroy_render_pipeline(&self, pipeline: Box<dyn DynRenderPipeline>)

source

unsafe fn create_compute_pipeline( &self, desc: &ComputePipelineDescriptor<'_, dyn DynPipelineLayout, dyn DynShaderModule, dyn DynPipelineCache>, ) -> Result<Box<dyn DynComputePipeline>, PipelineError>

source

unsafe fn destroy_compute_pipeline(&self, pipeline: Box<dyn DynComputePipeline>)

source

unsafe fn create_pipeline_cache( &self, desc: &PipelineCacheDescriptor<'_>, ) -> Result<Box<dyn DynPipelineCache>, PipelineCacheError>

source

unsafe fn destroy_pipeline_cache(&self, cache: Box<dyn DynPipelineCache>)

source

unsafe fn create_query_set( &self, desc: &QuerySetDescriptor<Label<'_>>, ) -> Result<Box<dyn DynQuerySet>, DeviceError>

source

unsafe fn destroy_query_set(&self, set: Box<dyn DynQuerySet>)

source

unsafe fn create_fence(&self) -> Result<Box<dyn DynFence>, DeviceError>

source

unsafe fn destroy_fence(&self, fence: Box<dyn DynFence>)

source

unsafe fn get_fence_value( &self, fence: &dyn DynFence, ) -> Result<FenceValue, DeviceError>

source

unsafe fn wait( &self, fence: &dyn DynFence, value: FenceValue, timeout_ms: u32, ) -> Result<bool, DeviceError>

source

unsafe fn start_capture(&self) -> bool

source

unsafe fn stop_capture(&self)

source

unsafe fn pipeline_cache_get_data( &self, cache: &dyn DynPipelineCache, ) -> Option<Vec<u8>>

source

unsafe fn create_acceleration_structure( &self, desc: &AccelerationStructureDescriptor<'_>, ) -> Result<Box<dyn DynAccelerationStructure>, DeviceError>

source

unsafe fn get_acceleration_structure_build_sizes( &self, desc: &GetAccelerationStructureBuildSizesDescriptor<'_, dyn DynBuffer>, ) -> AccelerationStructureBuildSizes

source

unsafe fn get_acceleration_structure_device_address( &self, acceleration_structure: &dyn DynAccelerationStructure, ) -> BufferAddress

source

unsafe fn destroy_acceleration_structure( &self, acceleration_structure: Box<dyn DynAccelerationStructure>, )

source

fn tlas_instance_to_bytes(&self, instance: TlasInstance) -> Vec<u8>

source

fn get_internal_counters(&self) -> HalCounters

source

fn generate_allocator_report(&self) -> Option<AllocatorReport>

Provided Methods§

Implementors§