[go: up one dir, main page]

Struct 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 duplicate 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>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

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

Source§

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.