Skip to main content

DeviceContext

Struct DeviceContext 

Source
pub struct DeviceContext(/* private fields */);

Implementations§

Source§

impl DeviceContext

Source

pub fn draw(&self, vertex_count: u32, start_vertex_location: u32)

Source

pub fn draw_auto(&self)

Source

pub fn draw_indexed( &self, index_count: u32, start_index_location: u32, base_vertex_location: i32, )

Source

pub fn draw_indexed_instanced( &self, index_count_per_instance: u32, instance_count: u32, start_index_location: u32, base_vertex_location: i32, start_instance_location: u32, )

Source

pub fn draw_indexed_instanced_indirect( &self, buffer_for_args: &Buffer, aligned_byte_offset_for_args: u32, )

Source

pub fn draw_instanced( &self, vertex_count_per_instance: u32, instance_count: u32, start_vertex_location: u32, start_instance_location: u32, )

Source

pub fn draw_instanced_indirect( &self, buffer_for_args: &Buffer, aligned_byte_offset_for_args: u32, )

Source§

impl DeviceContext

Source

pub fn input_assembler_set_primitive_topology( &self, topology: PrimitiveTopology, )

Source

pub fn input_assembler_set_input_layout( &self, layout: impl OptionalParam<Output = InputLayout>, )

Source

pub fn input_assembler_set_vertex_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], strides: Option<&[u32]>, offsets: Option<&[u32]>, ) -> Result<()>

Source

pub fn input_assembler_set_index_buffer( &self, buffer: impl OptionalParam<Output = Buffer>, format: Format, offset: u32, )

Source§

impl DeviceContext

Source

pub fn output_merger_set_render_targets( &self, render_target_views: &[Option<&RenderTargetView>], depth_stencil_view: Option<&DepthStencilView>, )

Source

pub fn output_merger_get_render_targets( &self, ) -> ([Option<RenderTargetView>; 8], Option<DepthStencilView>)

Source

pub fn output_merger_set_blend_state( &self, blend_state: impl OptionalParam<Output = BlendState>, blend_factor: Option<&[f32; 4]>, sample_mask: u32, )

Source

pub fn output_merger_set_depth_stencil_state( &self, depth_stencil_state: impl OptionalParam<Output = DepthStencilState>, stencil_ref: u32, )

Source§

impl DeviceContext

Source

pub fn begin(&self, async_: &impl Asynchronous)

Source

pub fn end(&self, async_: &impl Asynchronous)

Source§

impl DeviceContext

Source

pub fn rasterizer_set_viewports(&self, viewports: &[Viewport])

Source

pub fn rasterizer_get_viewports(&self) -> [Viewport; 8]

Source

pub fn rasterizer_set_scissor_rects(&self, rects: &[Rect])

Source

pub fn rasterizer_set_state( &self, state: impl OptionalParam<Output = RasterizerState>, )

Source§

impl DeviceContext

Source

pub const SAMPLER_SLOT_COUNT: usize

Source

pub const SHADER_RESOURCE_SLOT_COUNT: usize

Source

pub const CONSTANT_BUFFER_SLOT_COUNT: usize

Source

pub fn vertex_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn pixel_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn geometry_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn hull_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn domain_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn compute_set_constant_buffers( &self, start_slot: u32, buffers: &[Option<&Buffer>], )

Source

pub fn vertex_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn pixel_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn geometry_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn hull_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn domain_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn compute_set_constant_buffers1( &self, start_slot: u32, buffers: &[Option<&Buffer>], first_constant: Option<&[u32]>, num_constants: Option<&[u32]>, )

Source

pub fn vertex_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn pixel_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn geometry_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn hull_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn domain_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn compute_get_constant_buffers(&self) -> [Option<Buffer>; 14]

Source

pub fn vertex_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn pixel_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn geometry_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn hull_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn domain_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn compute_set_samplers( &self, start_slot: u32, samplers: &[Option<&SamplerState>], )

Source

pub fn vertex_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn pixel_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn geometry_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn hull_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn domain_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn compute_get_samplers(&self) -> [Option<SamplerState>; 16]

Source

pub fn vertex_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn pixel_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn geometry_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn hull_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn domain_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn compute_set_shader_resources( &self, start_slot: u32, views: &[Option<&ShaderResourceView>], )

Source

pub fn vertex_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn pixel_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn geometry_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn hull_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn domain_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn compute_get_shader_resources(&self) -> [Option<ShaderResourceView>; 128]

Source

pub fn compute_set_unordered_access_views( &self, start_slot: u32, views: &[Option<&UnorderedAccessView>], initial_counts: Option<&[u32]>, )

Source

pub fn vertex_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = VertexShader>,

Source

pub fn pixel_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = PixelShader>,

Source

pub fn geometry_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = GeometryShader>,

Source

pub fn hull_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = HullShader>,

Source

pub fn domain_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = DomainShader>,

Source

pub fn compute_set_shader<S>(&self, shader: S)
where S: OptionalParam<Output = ComputeShader>,

Source§

impl DeviceContext

Source

pub fn get_device(&self) -> Device

Source

pub fn get_user_defined_annotation(&self) -> UserDefinedAnnotation

Source

pub fn finish_command_list(&self, restore_state: bool) -> Result<CommandList>

Source

pub fn execute_command_list( &self, command_list: &CommandList, restore_state: bool, )

Source

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

Source

pub fn clear_depth_stencil_view( &self, dsv: &DepthStencilView, flags: ClearFlags, depth: f32, stencil: u8, )

Source

pub fn set_resource_min_lod(&self, resource: &impl Resource, min_lod: f32)

Source

pub fn flush(&self)

Source

pub fn clear_state(&self)

Source

pub fn get_type(&self) -> DeviceContextType

Source

pub fn map<T: Resource + Clone>( &self, resource: &T, subresource: u32, map_type: MapType, do_not_wait: bool, ) -> Result<SubresourceMapGuard<T>>

Maps a resource to a CPU-accessible memory region.

SAFETY: This function is safe to call, but operations on the mapped memory region are not.

Source

pub unsafe fn map_unchecked<T: Resource + Clone>( &self, resource: &T, subresource: u32, map_type: MapType, do_not_wait: bool, ) -> Result<MappedSubresource>

Source

pub fn unmap<T: Resource + Clone>(&self, resource: &T, subresource: u32)

Source

pub unsafe fn get_data<T: Sized>( &self, query: &impl Asynchronous, dont_flush: bool, ) -> GetDataResult<T>

Source

pub fn is_query_ready(&self, query: &impl Asynchronous) -> bool

Source

pub fn copy_resource<Src: Resource, Dest: Resource>( &self, src: &Src, dst: &Dest, )

Source

pub fn copy_subresource_region<Src: Resource, Dest: Resource>( &self, src: &Src, src_subresource: u32, src_box: Option<&Box3D>, dst: &Dest, dst_subresource: u32, dst_pos: (u32, u32, u32), )

Source

pub fn dispatch(&self, x: u32, y: u32, z: u32)

Trait Implementations§

Source§

impl Clone for DeviceContext

Source§

fn clone(&self) -> DeviceContext

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl DeviceChild for DeviceContext

Auto Trait Implementations§

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<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 = !

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.