Skip to content

Commit 49330ad

Browse files
committed
fixup! [naga] Generate special type for external texture params buffer
1 parent f48c117 commit 49330ad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

naga/src/ir/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,9 @@ pub struct SpecialTypes {
23632363
/// Struct containing parameters required by some backends to emit code for
23642364
/// [`ImageClass::External`] textures.
23652365
///
2366+
/// See `wgpu_core::device::resource::ExternalTextureParams` for the
2367+
/// documentation of each field.
2368+
///
23662369
/// In WGSL, this type would be:
23672370
///
23682371
/// ```ignore

wgpu-core/src/device/resource.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,18 @@ pub struct ExternalTextureParams {
8585
/// to RGBA.
8686
/// This is ignored when `num_planes` is 1.
8787
pub yuv_conversion_matrix: [f32; 16],
88-
/// 3x2 column-major matrix with which to multiply texture coordinates
89-
/// prior to sampling from the external texture.
88+
/// 3x2 column-major matrix with which to multiply normalized texture
89+
/// coordinates prior to sampling from the external texture. This may
90+
/// scale, translate, flip, and rotate in 90-degree increments, but the
91+
/// result of transforming the rectangle (0,0)..(1,1) must be an
92+
/// axis-aligned rectangle that falls within the bounds of (0,0)..(1,1).
9093
pub sample_transform: [f32; 6],
94+
/// 3x2 column-major matrix with which to multiply unnormalized texture
95+
/// coordinates prior to loading from the external texture. This may scale,
96+
/// translate, flip, and rotate in 90-degree increments, but the result of
97+
/// transforming the rectangle (0,0)..(texture_size - 1) must be an
98+
/// axis-aligned rectangle that falls within the bounds of
99+
/// (0,0)..(texture_size - 1).
91100
pub load_transform: [f32; 6],
92101
/// Size of the external texture. This value should be returned by size
93102
/// queries in shader code. Note that this may not match the dimensions of

0 commit comments

Comments
 (0)