Skip to main content

EfD3d11Layout

Struct EfD3d11Layout 

Source
#[repr(C)]
pub struct EfD3d11Layout { pub dxgi_format: u32, pub texture_width: u32, pub texture_height: u32, pub bytes_per_texel: u32, pub gl_internal_format: u32, }
Expand description

The D3D11 texture behind a Windows texture tensor.

The scalar block ef_tensor_d3d11_layout fills, the same shape as ef_tensor_plane and ef_tensor_view_origin – one library reading a tensor it did not mint. Mirrors edgefirst_tensor::d3d11_layout:: D3d11ImageLayout.

The dimensions are the texture’s, in texels and rows, not the image’s in pixels: a semi-planar image is one texture whose row count covers both planes, and a YUYV image is one texel per two pixels, so texture_width/texture_height do not match ef_tensor_shape for either. Read the image’s own dimensions from the shape.

For a semi-planar format (nv12, nv16, nv24) texture_width is the driver’s row pitch – at least even(width), and on a discrete adapter commonly more (128 bytes on NVIDIA, so a 64-wide NV12 image is a 128-wide texture). It is the pitch the combined plane’s rows are spaced by and the width a sampler must address the texture at. Never derive it from the image width: read this field, or ef_tensor_row_stride, which carries the same number.

By-value and frozen forever: a consumer bakes this size and these offsets into its call sites, so the struct evolves by a suffixed successor, never by an in-place edit. d3d11_layout_is_pinned and the C golden in tensor-capi/tests/c/test_layout_goldens.c hold both sides to it.

Fields§

§dxgi_format: u32

DXGI_FORMAT the texture was created with.

§texture_width: u32

Texture width in texels.

§texture_height: u32

Texture height in rows.

§bytes_per_texel: u32

Bytes per texel of dxgi_format.

§gl_internal_format: u32

The GL internal format an importer binds this texture as; 0 when the format has no GL equivalent.

Trait Implementations§

Source§

impl Clone for EfD3d11Layout

Source§

fn clone(&self) -> Self

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 Copy for EfD3d11Layout

Source§

impl Debug for EfD3d11Layout

Source§

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

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

impl Default for EfD3d11Layout

Source§

fn default() -> Self

Returns the “default value” for a type. 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, !>

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.