pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
pub unsafe fn init(desc: ContextDesc) -> Result<Self, NotSupportedError>
pub fn capabilities(&self) -> Capabilities
pub fn device_information(&self) -> &DeviceInformation
Source§impl Context
impl Context
pub fn create_compute_pipeline( &self, desc: ComputePipelineDesc<'_>, ) -> ComputePipeline
pub fn destroy_compute_pipeline(&self, pipeline: &mut ComputePipeline)
pub fn create_render_pipeline( &self, desc: RenderPipelineDesc<'_>, ) -> RenderPipeline
pub fn destroy_render_pipeline(&self, pipeline: &mut RenderPipeline)
Source§impl Context
impl Context
pub fn get_bottom_level_acceleration_structure_sizes( &self, meshes: &[AccelerationStructureMesh], ) -> AccelerationStructureSizes
pub fn get_top_level_acceleration_structure_sizes( &self, instance_count: u32, ) -> AccelerationStructureSizes
pub fn create_acceleration_structure_instance_buffer( &self, instances: &[AccelerationStructureInstance], bottom_level: &[AccelerationStructure], ) -> Buffer
pub fn get_external_texture_source( &self, texture: Texture, ) -> Option<ExternalMemorySource>
pub fn get_external_buffer_source( &self, buffer: Buffer, ) -> Option<ExternalMemorySource>
Source§impl Context
impl Context
pub fn create_buffer(&self, desc: BufferDesc<'_>) -> Buffer
pub fn sync_buffer(&self, _buffer: Buffer)
pub fn destroy_buffer(&self, buffer: Buffer)
pub fn create_texture(&self, desc: TextureDesc<'_>) -> Texture
pub fn destroy_texture(&self, texture: Texture)
pub fn create_texture_view( &self, texture: Texture, desc: TextureViewDesc<'_>, ) -> TextureView
pub fn destroy_texture_view(&self, view: TextureView)
pub fn create_sampler(&self, desc: SamplerDesc<'_>) -> Sampler
pub fn destroy_sampler(&self, sampler: Sampler)
pub fn create_acceleration_structure( &self, desc: AccelerationStructureDesc<'_>, ) -> AccelerationStructure
pub fn destroy_acceleration_structure( &self, acceleration_structure: AccelerationStructure, )
Source§impl Context
impl Context
pub fn create_surface<I: HasWindowHandle + HasDisplayHandle>( &self, window: &I, ) -> Result<Surface, NotSupportedError>
pub fn destroy_surface(&self, surface: &mut Surface)
pub fn reconfigure_surface(&self, surface: &mut Surface, config: SurfaceConfig)
Source§impl Context
impl Context
pub fn create_command_encoder( &self, desc: CommandEncoderDesc<'_>, ) -> CommandEncoder
pub fn destroy_command_encoder(&self, command_encoder: &mut CommandEncoder)
pub fn submit(&self, encoder: &mut CommandEncoder) -> SyncPoint
pub fn wait_for(&self, sp: &SyncPoint, timeout_ms: u32) -> bool
Source§impl Context
impl Context
pub fn try_create_shader( &self, desc: ShaderDesc<'_>, ) -> Result<Shader, &'static str>
pub fn create_shader(&self, desc: ShaderDesc<'_>) -> Shader
Source§impl Context
impl Context
pub fn create_surface_configured<I: HasWindowHandle + HasDisplayHandle>( &self, window: &I, config: SurfaceConfig, ) -> Result<Surface, NotSupportedError>
Trait Implementations§
Source§impl CommandDevice for Context
impl CommandDevice for Context
type CommandEncoder = CommandEncoder
type SyncPoint = SyncPoint
fn create_command_encoder(&self, desc: CommandEncoderDesc<'_>) -> CommandEncoder
fn destroy_command_encoder(&self, command_encoder: &mut CommandEncoder)
fn submit(&self, encoder: &mut CommandEncoder) -> SyncPoint
fn wait_for(&self, sp: &SyncPoint, timeout_ms: u32) -> bool
Source§impl ResourceDevice for Context
impl ResourceDevice for Context
type Buffer = Buffer
type Texture = Texture
type TextureView = TextureView
type Sampler = Sampler
type AccelerationStructure = AccelerationStructure
fn create_buffer(&self, desc: BufferDesc<'_>) -> Buffer
fn sync_buffer(&self, _buffer: Buffer)
fn destroy_buffer(&self, buffer: Buffer)
fn create_texture(&self, desc: TextureDesc<'_>) -> Texture
fn destroy_texture(&self, texture: Texture)
fn create_texture_view( &self, texture: Texture, desc: TextureViewDesc<'_>, ) -> TextureView
fn destroy_texture_view(&self, view: TextureView)
fn create_sampler(&self, desc: SamplerDesc<'_>) -> Sampler
fn destroy_sampler(&self, sampler: Sampler)
fn create_acceleration_structure( &self, desc: AccelerationStructureDesc<'_>, ) -> AccelerationStructure
fn destroy_acceleration_structure( &self, acceleration_structure: AccelerationStructure, )
Source§impl ShaderDevice for Context
impl ShaderDevice for Context
type ComputePipeline = ComputePipeline
type RenderPipeline = RenderPipeline
fn create_compute_pipeline( &self, desc: ComputePipelineDesc<'_>, ) -> ComputePipeline
fn destroy_compute_pipeline(&self, pipeline: &mut ComputePipeline)
fn create_render_pipeline(&self, desc: RenderPipelineDesc<'_>) -> RenderPipeline
fn destroy_render_pipeline(&self, pipeline: &mut RenderPipeline)
Auto Trait Implementations§
impl !Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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