Struct d3d12::ComPtr

source ·
pub struct ComPtr<T: Interface>(/* private fields */);

Implementations§

source§

impl<T: Interface> ComPtr<T>

source

pub fn null() -> Self

source

pub unsafe fn from_raw(raw: *mut T) -> Self

source

pub fn is_null(&self) -> bool

source

pub fn as_ptr(&self) -> *const T

source

pub fn as_mut_ptr(&self) -> *mut T

source

pub fn mut_void(&mut self) -> *mut *mut c_void

source

pub fn mut_self(&mut self) -> *mut *mut T

source§

impl<T: Interface> ComPtr<T>

source

pub unsafe fn as_unknown(&self) -> &IUnknown

source

pub unsafe fn cast<U>(&self) -> D3DResult<ComPtr<U>>
where U: Interface,

source§

impl ComPtr<ID3D12CommandAllocator>

source

pub fn reset(&self)

source§

impl ComPtr<ID3D12GraphicsCommandList>

source

pub fn as_list(&self) -> CommandList

source

pub fn close(&self) -> HRESULT

source

pub fn reset( &self, allocator: &CommandAllocator, initial_pso: PipelineState ) -> HRESULT

source

pub fn discard_resource(&self, resource: Resource, region: DiscardRegion<'_>)

source

pub fn clear_depth_stencil_view( &self, dsv: CpuDescriptor, flags: ClearFlags, depth: f32, stencil: u8, rects: &[Rect] )

source

pub fn clear_render_target_view( &self, rtv: CpuDescriptor, color: [f32; 4], rects: &[Rect] )

source

pub fn dispatch(&self, count: WorkGroupCount)

source

pub fn draw( &self, num_vertices: VertexCount, num_instances: InstanceCount, first_vertex: VertexCount, first_instance: InstanceCount )

source

pub fn draw_indexed( &self, num_indices: IndexCount, num_instances: InstanceCount, first_index: IndexCount, base_vertex: VertexOffset, first_instance: InstanceCount )

source

pub fn set_index_buffer( &self, gpu_address: GpuAddress, size: u32, format: Format )

source

pub fn set_blend_factor(&self, factor: [f32; 4])

source

pub fn set_stencil_reference(&self, reference: u32)

source

pub fn set_pipeline_state(&self, pso: &PipelineState)

source

pub fn execute_bundle(&self, bundle: GraphicsCommandList)

source

pub fn set_descriptor_heaps(&self, heaps: &[DescriptorHeap])

source

pub fn set_compute_root_signature(&self, signature: &RootSignature)

source

pub fn set_graphics_root_signature(&self, signature: &RootSignature)

source

pub fn set_compute_root_descriptor_table( &self, root_index: RootIndex, base_descriptor: GpuDescriptor )

source

pub fn set_compute_root_constant_buffer_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_compute_root_shader_resource_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_compute_root_unordered_access_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_compute_root_constant( &self, root_index: RootIndex, value: u32, dest_offset_words: u32 )

source

pub fn set_graphics_root_descriptor_table( &self, root_index: RootIndex, base_descriptor: GpuDescriptor )

source

pub fn set_graphics_root_constant_buffer_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_graphics_root_shader_resource_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_graphics_root_unordered_access_view( &self, root_index: RootIndex, buffer_location: GpuAddress )

source

pub fn set_graphics_root_constant( &self, root_index: RootIndex, value: u32, dest_offset_words: u32 )

source

pub fn resource_barrier(&self, barriers: &[ResourceBarrier])

source§

impl ComPtr<ID3D12Debug>

source§

impl ComPtr<ID3D12DescriptorHeap>

source§

impl ComPtr<ID3D12Device>

source

pub fn create_heap( &self, size_in_bytes: u64, properties: HeapProperties, alignment: u64, flags: HeapFlags ) -> D3DResult<Heap>

source

pub fn create_command_allocator( &self, list_type: CmdListType ) -> D3DResult<CommandAllocator>

source

pub fn create_command_queue( &self, list_type: CmdListType, priority: Priority, flags: CommandQueueFlags, node_mask: NodeMask ) -> D3DResult<CommandQueue>

source

pub fn create_descriptor_heap( &self, num_descriptors: u32, heap_type: DescriptorHeapType, flags: DescriptorHeapFlags, node_mask: NodeMask ) -> D3DResult<DescriptorHeap>

source

pub fn get_descriptor_increment_size( &self, heap_type: DescriptorHeapType ) -> u32

source

pub fn create_graphics_command_list( &self, list_type: CmdListType, allocator: &CommandAllocator, initial: PipelineState, node_mask: NodeMask ) -> D3DResult<GraphicsCommandList>

source

pub fn create_query_heap( &self, heap_ty: QueryHeapType, count: u32, node_mask: NodeMask ) -> D3DResult<QueryHeap>

source

pub fn create_graphics_pipeline_state( &self, _root_signature: RootSignature, _vs: Shader<'_>, _ps: Shader<'_>, _gs: Shader<'_>, _hs: Shader<'_>, _ds: Shader<'_>, _node_mask: NodeMask, _cached_pso: CachedPSO<'_>, _flags: PipelineStateFlags ) -> D3DResult<PipelineState>

source

pub fn create_compute_pipeline_state( &self, root_signature: &RootSignature, cs: Shader<'_>, node_mask: NodeMask, cached_pso: CachedPSO<'_>, flags: PipelineStateFlags ) -> D3DResult<PipelineState>

source

pub fn create_sampler( &self, sampler: CpuDescriptor, filter: D3D12_FILTER, address_mode: TextureAddressMode, mip_lod_bias: f32, max_anisotropy: u32, comparison_op: D3D12_COMPARISON_FUNC, border_color: [f32; 4], lod: Range<f32> )

source

pub fn create_root_signature( &self, blob: Blob, node_mask: NodeMask ) -> D3DResult<RootSignature>

source

pub fn create_command_signature( &self, root_signature: RootSignature, arguments: &[IndirectArgument], stride: u32, node_mask: NodeMask ) -> D3DResult<CommandSignature>

source

pub fn create_render_target_view( &self, resource: Resource, desc: &RenderTargetViewDesc, descriptor: CpuDescriptor )

source

pub fn create_fence(&self, initial: u64) -> D3DResult<Fence>

source§

impl ComPtr<IDXGIFactory1>

source

pub fn create_swapchain( &self, queue: *mut IUnknown, hwnd: HWND, desc: &SwapchainDesc ) -> D3DResult<SwapChain>

source§

impl ComPtr<IDXGIFactory2>

source§

impl ComPtr<IDXGIFactory4>

source§

impl ComPtr<IDXGIFactoryMedia>

source§

impl ComPtr<IDXGISwapChain>

source

pub fn get_buffer(&self, id: u32) -> D3DResult<Resource>

source

pub fn present(&self, interval: u32, flags: u32) -> HRESULT

source

pub fn present_flags( &self, interval: u32, flags: SwapChainPresentFlags ) -> HRESULT

source§

impl ComPtr<IDXGISwapChain3>

source§

impl ComPtr<ID3D12CommandQueue>

source

pub fn execute_command_lists(&self, command_lists: &[CommandList])

source

pub fn signal(&self, fence: &Fence, value: u64) -> HRESULT

source§

impl ComPtr<ID3D12Resource>

source

pub fn map( &self, subresource: Subresource, read_range: Option<Range<usize>> ) -> D3DResult<*mut ()>

source

pub fn unmap(&self, subresource: Subresource, write_range: Option<Range<usize>>)

source

pub fn gpu_virtual_address(&self) -> u64

source§

impl ComPtr<ID3D12Fence>

source

pub fn set_event_on_completion(&self, event: Event, value: u64) -> HRESULT

source

pub fn get_value(&self) -> u64

source

pub fn signal(&self, value: u64) -> HRESULT

source§

impl ComPtr<ID3D10Blob>

source

pub unsafe fn as_c_str(&self) -> &CStr

Trait Implementations§

source§

impl<T: Interface> Clone for ComPtr<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Interface> Debug for ComPtr<T>

source§

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

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

impl<T: Interface> Deref for ComPtr<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T: Interface> Drop for ComPtr<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T: Interface> Hash for ComPtr<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: Interface> PartialEq<*mut T> for ComPtr<T>

source§

fn eq(&self, other: &*mut T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Interface> PartialEq for ComPtr<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T> Freeze for ComPtr<T>

§

impl<T> RefUnwindSafe for ComPtr<T>
where T: RefUnwindSafe,

§

impl<T> !Send for ComPtr<T>

§

impl<T> !Sync for ComPtr<T>

§

impl<T> Unpin for ComPtr<T>

§

impl<T> UnwindSafe for ComPtr<T>
where T: RefUnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.