#[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: u32DXGI_FORMAT the texture was created with.
texture_width: u32Texture width in texels.
texture_height: u32Texture height in rows.
bytes_per_texel: u32Bytes per texel of dxgi_format.
gl_internal_format: u32The GL internal format an importer binds this texture as; 0 when the format has no GL equivalent.