Skip to main content

Device

Struct Device 

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

Implementations§

Source§

impl Device

Source

pub fn create(adapter: Option<IDXGIAdapter>, debug: bool) -> Result<Self>

Temporary method for creating a device. ImmediateContext can be retrieved by calling device.immediate_context()

Source§

impl Device

Source

pub fn get_immediate_context(&self) -> DeviceContext

Source

pub fn create_deferred_context(&self) -> Result<DeviceContext>

Source

pub fn create_sampler_state(&self, desc: &SamplerDesc) -> Result<SamplerState>

Source

pub fn create_buffer( &self, desc: &BufferDesc, initial_data: Option<&[u8]>, ) -> Result<Buffer>

Source

pub fn create_texture1d( &self, desc: &Texture1dDesc, initial_data: Option<&[D3D11_SUBRESOURCE_DATA]>, ) -> Result<Texture1D>

Source

pub fn create_texture2d( &self, desc: &Texture2dDesc, initial_data: Option<&[D3D11_SUBRESOURCE_DATA]>, ) -> Result<Texture2D>

Source

pub fn create_texture3d( &self, desc: &Texture3dDesc, initial_data: Option<&[D3D11_SUBRESOURCE_DATA]>, ) -> Result<Texture3D>

Source

pub fn create_vertex_shader(&self, bytecode: &[u8]) -> Result<VertexShader>

Source

pub fn create_pixel_shader(&self, bytecode: &[u8]) -> Result<PixelShader>

Source

pub fn create_geometry_shader(&self, bytecode: &[u8]) -> Result<GeometryShader>

Source

pub fn create_hull_shader(&self, bytecode: &[u8]) -> Result<HullShader>

Source

pub fn create_domain_shader(&self, bytecode: &[u8]) -> Result<DomainShader>

Source

pub fn create_compute_shader(&self, bytecode: &[u8]) -> Result<ComputeShader>

Source

pub fn create_render_target_view( &self, resource: &impl Resource, desc: Option<&RenderTargetViewDesc>, ) -> Result<RenderTargetView>

Creates a RenderTargetView for the given resource

Set desc to None to create a view that accesses all of the subresources in mipmap level 0

Source

pub fn create_depth_stencil_view( &self, resource: &impl Resource, desc: Option<&DepthStencilViewDesc>, ) -> Result<DepthStencilView>

Source

pub fn create_shader_resource_view( &self, resource: &impl Resource, desc: impl OptionalParam<Output = ShaderResourceViewDesc>, ) -> Result<ShaderResourceView>

Source

pub fn create_unordered_access_view( &self, resource: &impl Resource, desc: impl OptionalParam<Output = UnorderedAccessViewDesc>, ) -> Result<UnorderedAccessView>

Source

pub fn create_input_layout( &self, desc: &[InputElementDesc], shader_bytecode: &[u8], ) -> Result<InputLayout>

Source

pub fn create_rasterizer_state( &self, desc: &RasterizerDesc, ) -> Result<RasterizerState>

Source

pub fn create_depth_stencil_state( &self, desc: &DepthStencilDesc, ) -> Result<DepthStencilState>

Source

pub fn create_blend_state(&self, desc: &BlendDesc) -> Result<BlendState>

Source

pub fn create_query(&self, desc: &QueryDesc) -> Result<Query>

Source

pub fn check_format_support(&self, format: Format) -> FormatSupport

Trait Implementations§

Source§

impl Clone for Device

Source§

fn clone(&self) -> Device

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

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.