Rework the ExternalTexture computations slightly for clarity.
Bug: 41487285
Change-Id: Ia629fed771c157d88895146d206212a054c69c81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/187080
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
diff --git a/src/dawn/native/ExternalTexture.cpp b/src/dawn/native/ExternalTexture.cpp
index 9079300..a1a8a3b 100644
--- a/src/dawn/native/ExternalTexture.cpp
+++ b/src/dawn/native/ExternalTexture.cpp
@@ -215,16 +215,23 @@
// Unlike WGSL, which stores matrices in column vectors, the following arithmetic uses row
// vectors, so elements are stored in the following order:
+ //
// ┌ ┐
// │ 0, 1, 2 │
// │ 3, 4, 5 │
// └ ┘
+ //
// The matrix is transposed at the end.
+ //
+ // Note that we are working in homogeneous coordinates so there is an implied third row
+ // containing [0, 0, 1].
using mat2x3 = std::array<float, 6>;
+ // Likewise the vectors have an implicit last element that's 1.
+ using vec2 = std::array<float, 2>;
// Multiplies the two mat2x3 matrices, by treating the RHS matrix as a mat3x3 where the last row
// is [0, 0, 1].
- auto Mul = [&](const mat2x3& lhs, const mat2x3& rhs) {
+ auto Mul = [](const mat2x3& lhs, const mat2x3& rhs) -> mat2x3 {
auto& a = lhs[0];
auto& b = lhs[1];
auto& c = lhs[2];
@@ -251,30 +258,37 @@
d * i + e * l + f, //
};
};
-
- auto Scale = [&](const mat2x3& m, float x, float y) {
- return Mul(mat2x3{x, 0, 0, 0, y, 0}, m);
+ auto Scale = [](float x, float y) -> mat2x3 { return {x, 0, 0, 0, y, 0}; };
+ auto ScaleVec = [&](vec2 v) -> mat2x3 { return Scale(v[0], v[1]); };
+ auto Translate = [](float x, float y) -> mat2x3 { return mat2x3{1, 0, x, 0, 1, y}; };
+ auto TranslateVec = [&](vec2 v) -> mat2x3 { return Translate(v[0], v[1]); };
+ auto TransposeForWGSL = [](const mat2x3& m) -> std::array<float, 6> {
+ return {m[0], m[3], m[1], m[4], m[2], m[5]};
};
- auto Translate = [&](const mat2x3& m, float x, float y) {
- return Mul(mat2x3{1, 0, x, 0, 1, y}, m);
- };
+ // Vector operations
+ auto Add = [](const vec2& a, const vec2& b) -> vec2 { return {a[0] + b[0], a[1] + b[1]}; };
+ auto Sub = [](const vec2& a, const vec2& b) -> vec2 { return {a[0] - b[0], a[1] - b[1]}; };
+ auto Div = [](const vec2& a, const vec2& b) -> vec2 { return {a[0] / b[0], a[1] / b[1]}; };
- mat2x3 coordTransformMatrix = {
- 1, 0, 0, //
- 0, 1, 0, //
- };
-
- Extent3D frameSize = descriptor->plane0->GetSingleSubresourceVirtualSize();
- Extent3D plane1Size = {1, 1, 1};
-
+ // Extract all the relevant sizes as float to avoid extra casts in later computations.
+ Extent3D plane0Extent = descriptor->plane0->GetSingleSubresourceVirtualSize();
+ Extent3D plane1Extent = {1, 1, 1};
if (params.numPlanes == 2) {
- plane1Size = descriptor->plane1->GetSingleSubresourceVirtualSize();
+ plane1Extent = descriptor->plane1->GetSingleSubresourceVirtualSize();
}
+ vec2 plane0Size = {static_cast<float>(plane0Extent.width),
+ static_cast<float>(plane0Extent.height)};
+ vec2 plane1Size = {static_cast<float>(plane1Extent.width),
+ static_cast<float>(plane1Extent.height)};
+ vec2 visibleOrigin = {static_cast<float>(mVisibleOrigin.x),
+ static_cast<float>(mVisibleOrigin.y)};
+ vec2 visibleSize = {static_cast<float>(mVisibleSize.width),
+ static_cast<float>(mVisibleSize.height)};
// Offset the coordinates so the center texel is at the origin, so we can apply rotations and
// y-flips. After translation, coordinates range from [-0.5 .. +0.5] in both U and V.
- coordTransformMatrix = Translate(coordTransformMatrix, -0.5, -0.5);
+ mat2x3 sampleTransform = Translate(-0.5, -0.5);
// Texture applies rotation first and do mirrored(horizontal flip) next.
// Do reverse order here to mapping final uv coordinate to origin texture.
@@ -284,107 +298,68 @@
// attribute and pass mirrored to descriptor->flipY and this is incorrect. Workaround to fix
// mirrored issue by delegate flipY operation to mirrored and remove flipY attribute in future.
if (descriptor->flipY || descriptor->mirrored) {
- coordTransformMatrix = Scale(coordTransformMatrix, -1, 1);
+ sampleTransform = Mul(Scale(-1, 1), sampleTransform);
}
- // Apply rotations as needed.
+ // Apply rotations as needed this may rotate the shader-visible size of the texture for
+ // textureLoad operations.
+ std::array<uint32_t, 2> loadBounds = {mVisibleSize.width - 1, mVisibleSize.height - 1};
switch (descriptor->rotation) {
case wgpu::ExternalTextureRotation::Rotate0Degrees:
break;
case wgpu::ExternalTextureRotation::Rotate90Degrees:
- coordTransformMatrix = Mul(mat2x3{0, +1, 0, // x' = y
- -1, 0, 0}, // y' = -x
- coordTransformMatrix);
+ sampleTransform = Mul(mat2x3{0, +1, 0, // x' = y
+ -1, 0, 0}, // y' = -x
+ sampleTransform);
break;
case wgpu::ExternalTextureRotation::Rotate180Degrees:
- coordTransformMatrix = Mul(mat2x3{-1, 0, 0, // x' = -x
- 0, -1, 0}, // y' = -y
- coordTransformMatrix);
+ sampleTransform = Mul(mat2x3{-1, 0, 0, // x' = -x
+ 0, -1, 0}, // y' = -y
+ sampleTransform);
break;
case wgpu::ExternalTextureRotation::Rotate270Degrees:
- coordTransformMatrix = Mul(mat2x3{0, -1, 0, // x' = -y
- +1, 0, 0}, // y' = x
- coordTransformMatrix);
+ sampleTransform = Mul(mat2x3{0, -1, 0, // x' = -y
+ +1, 0, 0}, // y' = x
+ sampleTransform);
break;
}
// Offset the coordinates so the bottom-left texel is at origin.
// After translation, coordinates range from [0 .. 1] in both U and V.
- coordTransformMatrix = Translate(coordTransformMatrix, 0.5, 0.5);
-
- // Calculate scale factors and offsets from the specified visibleSize.
- DAWN_ASSERT(mVisibleSize.width > 0);
- DAWN_ASSERT(mVisibleSize.height > 0);
- float xScale = static_cast<float>(mVisibleSize.width) / static_cast<float>(frameSize.width);
- float yScale = static_cast<float>(mVisibleSize.height) / static_cast<float>(frameSize.height);
- float xOffset = static_cast<float>(mVisibleOrigin.x) / static_cast<float>(frameSize.width);
- float yOffset = static_cast<float>(mVisibleOrigin.y) / static_cast<float>(frameSize.height);
+ sampleTransform = Mul(Translate(0.5, 0.5), sampleTransform);
// Finally, scale and translate based on the visible rect. This applies cropping.
- coordTransformMatrix = Scale(coordTransformMatrix, xScale, yScale);
- coordTransformMatrix = Translate(coordTransformMatrix, xOffset, yOffset);
+ vec2 rectScale = Div(visibleSize, plane0Size);
+ vec2 rectOffset = Div(visibleOrigin, plane0Size);
+ sampleTransform = Mul(TranslateVec(rectOffset), Mul(ScaleVec(rectScale), sampleTransform));
- // Calculate load transformation matrix by using
- // toTexels * coordTransformMatrix * toNormalized
+ params.sampleTransform = TransposeForWGSL(sampleTransform);
+
+ // Compute the load transformation matrix by using toTexels * sampleTransform * toNormalized
// Note that coords starts from 0 so the max value is size - 1.
- mat2x3 toTexels = {static_cast<float>(frameSize.width - 1), 0, 0, 0,
- static_cast<float>(frameSize.height - 1), 0};
+ {
+ mat2x3 toTexels = ScaleVec(Sub(plane0Size, {1.0f, 1.0f}));
+ mat2x3 toNormalized = Scale(1.0f / loadBounds[0], 1.0f / loadBounds[1]);
+ mat2x3 loadTransform = Mul(toTexels, Mul(sampleTransform, toNormalized));
- bool orientationChanged =
- descriptor->rotation == wgpu::ExternalTextureRotation::Rotate90Degrees ||
- descriptor->rotation == wgpu::ExternalTextureRotation::Rotate270Degrees;
+ params.loadTransform = TransposeForWGSL(loadTransform);
+ }
- uint32_t displayVisibleWidth = orientationChanged ? mVisibleSize.height : mVisibleSize.width;
- uint32_t displayVisibleHeight = orientationChanged ? mVisibleSize.width : mVisibleSize.height;
+ // Compute the clamping for each plane individually: to avoid bleeding of OOB texels due to
+ // interpolation we need to offset by a half texel in, which depends on the size of the plane.
+ {
+ vec2 plane0HalfTexel = Div({0.5f, 0.5f}, plane0Size);
+ vec2 plane1HalfTexel = Div({0.5f, 0.5f}, plane1Size);
- mat2x3 toNormalized = {1.0f / static_cast<float>(displayVisibleWidth - 1), 0, 0, 0,
- 1.0f / static_cast<float>(displayVisibleHeight - 1), 0};
+ params.samplePlane0RectMin = Add(rectOffset, plane0HalfTexel);
+ params.samplePlane1RectMin = Add(rectOffset, plane1HalfTexel);
+ params.samplePlane0RectMax = Sub(Add(rectOffset, rectScale), plane0HalfTexel);
+ params.samplePlane1RectMax = Sub(Add(rectOffset, rectScale), plane1HalfTexel);
+ }
- mat2x3 loadTransformMatrix = Mul(toTexels, Mul(coordTransformMatrix, toNormalized));
-
- // Transpose the mat2x3 into column vectors for use by WGSL.
- params.coordTransformMatrix[0] = coordTransformMatrix[0];
- params.coordTransformMatrix[1] = coordTransformMatrix[3];
- params.coordTransformMatrix[2] = coordTransformMatrix[1];
- params.coordTransformMatrix[3] = coordTransformMatrix[4];
- params.coordTransformMatrix[4] = coordTransformMatrix[2];
- params.coordTransformMatrix[5] = coordTransformMatrix[5];
-
- params.loadTransformMatrix[0] = loadTransformMatrix[0];
- params.loadTransformMatrix[1] = loadTransformMatrix[3];
- params.loadTransformMatrix[2] = loadTransformMatrix[1];
- params.loadTransformMatrix[3] = loadTransformMatrix[4];
- params.loadTransformMatrix[4] = loadTransformMatrix[2];
- params.loadTransformMatrix[5] = loadTransformMatrix[5];
-
- // clamped rect for sample and load
- float plane0HalfTexelX = 0.5 / static_cast<float>(frameSize.width);
- float plane0HalfTexelY = 0.5 / static_cast<float>(frameSize.height);
- float plane1HalfTexelX = 0.5 / static_cast<float>(plane1Size.width);
- float plane1HalfTexelY = 0.5 / static_cast<float>(plane1Size.height);
-
- float normVisibleRectMinX = xOffset;
- float normVisibleRectMinY = yOffset;
- float normVisibleRectMaxX = xOffset + xScale;
- float normVisibleRectMaxY = yOffset + yScale;
-
- params.samplePlane0RectMin[0] = normVisibleRectMinX + plane0HalfTexelX;
- params.samplePlane0RectMin[1] = normVisibleRectMinY + plane0HalfTexelY;
- params.samplePlane0RectMax[0] = normVisibleRectMaxX - plane0HalfTexelX;
- params.samplePlane0RectMax[1] = normVisibleRectMaxY - plane0HalfTexelY;
- params.samplePlane1RectMin[0] = normVisibleRectMinX + plane1HalfTexelX;
- params.samplePlane1RectMin[1] = normVisibleRectMinY + plane1HalfTexelY;
- params.samplePlane1RectMax[0] = normVisibleRectMaxX - plane1HalfTexelX;
- params.samplePlane1RectMax[1] = normVisibleRectMaxY - plane1HalfTexelY;
-
- params.displayVisibleRectMax[0] = displayVisibleWidth - 1;
- params.displayVisibleRectMax[1] = displayVisibleHeight - 1;
-
- params.plane1CoordFactor[0] =
- static_cast<float>(plane1Size.width) / static_cast<float>(frameSize.width);
- params.plane1CoordFactor[1] =
- static_cast<float>(plane1Size.height) / static_cast<float>(frameSize.height);
+ params.plane1CoordFactor = Div(plane1Size, plane0Size);
+ params.visibleSize = loadBounds;
DAWN_TRY(device->GetQueue()->WriteBuffer(mParamsBuffer.Get(), 0, ¶ms,
sizeof(ExternalTextureParams)));
diff --git a/src/dawn/native/ExternalTexture.h b/src/dawn/native/ExternalTexture.h
index a2decc0..46c3f7b 100644
--- a/src/dawn/native/ExternalTexture.h
+++ b/src/dawn/native/ExternalTexture.h
@@ -48,13 +48,13 @@
std::array<float, 8> gammaDecodingParams = {};
std::array<float, 8> gammaEncodingParams = {};
std::array<float, 12> gamutConversionMatrix = {};
- std::array<float, 6> coordTransformMatrix = {};
- std::array<float, 6> loadTransformMatrix = {};
+ std::array<float, 6> sampleTransform = {};
+ std::array<float, 6> loadTransform = {};
std::array<float, 2> samplePlane0RectMin = {};
std::array<float, 2> samplePlane0RectMax = {};
std::array<float, 2> samplePlane1RectMin = {};
std::array<float, 2> samplePlane1RectMax = {};
- std::array<uint32_t, 2> displayVisibleRectMax = {};
+ std::array<uint32_t, 2> visibleSize = {};
// textureLoad() passes coords in plane0 related size.
// Use this Factor to calculate plane1 load coord.
std::array<float, 2> plane1CoordFactor = {};
diff --git a/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc b/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
index aa0d1dc..8637697 100644
--- a/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
+++ b/src/tint/lang/core/ir/transform/multiplanar_external_texture.cc
@@ -304,13 +304,13 @@
{sym.Register("gammaDecodeParams"), GammaTransferParams()},
{sym.Register("gammaEncodeParams"), GammaTransferParams()},
{sym.Register("gamutConversionMatrix"), ty.mat3x3<f32>()},
- {sym.Register("coordTransformationMatrix"), ty.mat3x2<f32>()},
- {sym.Register("loadTransformationMatrix"), ty.mat3x2<f32>()},
+ {sym.Register("sampleTransform"), ty.mat3x2<f32>()},
+ {sym.Register("loadTransform"), ty.mat3x2<f32>()},
{sym.Register("samplePlane0RectMin"), ty.vec2<f32>()},
{sym.Register("samplePlane0RectMax"), ty.vec2<f32>()},
{sym.Register("samplePlane1RectMin"), ty.vec2<f32>()},
{sym.Register("samplePlane1RectMax"), ty.vec2<f32>()},
- {sym.Register("displayVisibleRectMax"), ty.vec2<u32>()},
+ {sym.Register("visibleSize"), ty.vec2<u32>()},
{sym.Register("plane1CoordFactor"), ty.vec2<f32>()}});
}
return external_texture_params_struct;
@@ -375,9 +375,9 @@
// plane1 : texture_2d<f32>,
// coords : vec2<u32>,
// params : ExternalTextureParams) ->vec4f {
- // let clampedCoords = min(coords, params.displayVisibleRectMax);
+ // let clampedCoords = min(coords, params.visibleSize);
// let plane0_clamped = vec2<u32>(
- // round(params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1)));
+ // round(params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1)));
// var color : vec4<f32>;
// if ((params.numPlanes == 1)) {
// color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -493,7 +493,7 @@
// smp : sampler,
// coord : vec2f,
// params : ExternalTextureParams) ->vec4f {
- // let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ // let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
// let plane0_clamped =
// clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
// var color : vec4<f32>;
diff --git a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
index f032ba8..39b06e8 100644
--- a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
@@ -97,13 +97,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -170,13 +170,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -249,13 +249,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -331,13 +331,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -492,13 +492,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -656,13 +656,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -838,13 +838,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -1044,13 +1044,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
@@ -1240,13 +1240,13 @@
gammaDecodeParams:tint_GammaTransferParams @offset(64)
gammaEncodeParams:tint_GammaTransferParams @offset(96)
gamutConversionMatrix:mat3x3<f32> @offset(128)
- coordTransformationMatrix:mat3x2<f32> @offset(176)
- loadTransformationMatrix:mat3x2<f32> @offset(200)
+ sampleTransform:mat3x2<f32> @offset(176)
+ loadTransform:mat3x2<f32> @offset(200)
samplePlane0RectMin:vec2<f32> @offset(224)
samplePlane0RectMax:vec2<f32> @offset(232)
samplePlane1RectMin:vec2<f32> @offset(240)
samplePlane1RectMax:vec2<f32> @offset(248)
- displayVisibleRectMax:vec2<u32> @offset(256)
+ visibleSize:vec2<u32> @offset(256)
plane1CoordFactor:vec2<f32> @offset(264)
}
diff --git a/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture.cc b/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture.cc
index 51b5f1e..0b59b7d 100644
--- a/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture.cc
+++ b/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture.cc
@@ -294,13 +294,13 @@
b.Member("gammaDecodeParams", b.ty("GammaTransferParams")),
b.Member("gammaEncodeParams", b.ty("GammaTransferParams")),
b.Member("gamutConversionMatrix", b.ty.mat3x3<f32>()),
- b.Member("coordTransformationMatrix", b.ty.mat3x2<f32>()),
- b.Member("loadTransformationMatrix", b.ty.mat3x2<f32>()),
+ b.Member("sampleTransform", b.ty.mat3x2<f32>()),
+ b.Member("loadTransform", b.ty.mat3x2<f32>()),
b.Member("samplePlane0RectMin", b.ty.vec2<f32>()),
b.Member("samplePlane0RectMax", b.ty.vec2<f32>()),
b.Member("samplePlane1RectMin", b.ty.vec2<f32>()),
b.Member("samplePlane1RectMax", b.ty.vec2<f32>()),
- b.Member("displayVisibleRectMax", b.ty.vec2<u32>()),
+ b.Member("visibleSize", b.ty.vec2<u32>()),
b.Member("plane1CoordFactor", b.ty.vec2<f32>())};
params_struct_sym = b.Symbols().New("ExternalTextureParams");
@@ -354,9 +354,9 @@
const BlockStatement* multi_plane_block = nullptr;
switch (call_type) {
case wgsl::BuiltinFn::kTextureSampleBaseClampToEdge:
- stmts.Push(b.Decl(b.Let(
- "modifiedCoords", b.Mul(b.MemberAccessor("params", "coordTransformationMatrix"),
- b.Call<vec3<f32>>("coord", 1_a)))));
+ stmts.Push(b.Decl(
+ b.Let("modifiedCoords", b.Mul(b.MemberAccessor("params", "sampleTransform"),
+ b.Call<vec3<f32>>("coord", 1_a)))));
stmts.Push(b.Decl(b.Let(
"plane0_clamped", b.Call("clamp", "modifiedCoords",
@@ -391,14 +391,14 @@
1_a)));
break;
case wgsl::BuiltinFn::kTextureLoad:
- stmts.Push(b.Decl(b.Let(
- "clampedCoords", b.Call("min", b.Call<vec2<u32>>("coord"),
- b.MemberAccessor("params", "displayVisibleRectMax")))));
+ stmts.Push(b.Decl(
+ b.Let("clampedCoords", b.Call("min", b.Call<vec2<u32>>("coord"),
+ b.MemberAccessor("params", "visibleSize")))));
stmts.Push(b.Decl(b.Let(
"plane0_clamped",
b.Call<vec2<u32>>(b.Call(
"round",
- b.Mul(b.MemberAccessor("params", "loadTransformationMatrix"),
+ b.Mul(b.MemberAccessor("params", "loadTransform"),
b.Call<vec3<f32>>(b.Call<vec2<f32>>("clampedCoords"), 1_a)))))));
// var color: vec4<f32>;
diff --git a/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture_test.cc b/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture_test.cc
index 8f78af9..65c7b41 100644
--- a/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/lang/wgsl/ast/transform/multiplanar_external_texture_test.cc
@@ -152,13 +152,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -212,13 +212,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -236,8 +236,8 @@
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<u32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -301,13 +301,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -363,13 +363,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -389,7 +389,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -450,13 +450,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -472,7 +472,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -538,13 +538,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -562,8 +562,8 @@
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -580,8 +580,8 @@
}
fn textureLoadExternal_1(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<u32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -644,13 +644,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -666,8 +666,8 @@
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -684,8 +684,8 @@
}
fn textureLoadExternal_1(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<u32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -749,13 +749,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -775,7 +775,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -793,8 +793,8 @@
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -854,13 +854,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -876,7 +876,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -894,8 +894,8 @@
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
- let clampedCoords = min(vec2<u32>(coord), params.displayVisibleRectMax);
- let plane0_clamped = vec2<u32>(round((params.loadTransformationMatrix * vec3<f32>(vec2<f32>(clampedCoords), 1))));
+ let clampedCoords = min(vec2<u32>(coord), params.visibleSize);
+ let plane0_clamped = vec2<u32>(round((params.loadTransform * vec3<f32>(vec2<f32>(clampedCoords), 1))));
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
color = textureLoad(plane0, plane0_clamped, 0).rgba;
@@ -965,13 +965,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1009,7 +1009,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1079,13 +1079,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1101,7 +1101,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1175,13 +1175,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1202,7 +1202,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1271,13 +1271,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1293,7 +1293,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1369,13 +1369,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1395,7 +1395,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1476,13 +1476,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1507,7 +1507,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1584,13 +1584,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1606,7 +1606,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1688,13 +1688,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1710,7 +1710,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1780,13 +1780,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1839,13 +1839,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1863,7 +1863,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
@@ -1938,13 +1938,13 @@
gammaDecodeParams : GammaTransferParams,
gammaEncodeParams : GammaTransferParams,
gamutConversionMatrix : mat3x3<f32>,
- coordTransformationMatrix : mat3x2<f32>,
- loadTransformationMatrix : mat3x2<f32>,
+ sampleTransform : mat3x2<f32>,
+ loadTransform : mat3x2<f32>,
samplePlane0RectMin : vec2<f32>,
samplePlane0RectMax : vec2<f32>,
samplePlane1RectMin : vec2<f32>,
samplePlane1RectMax : vec2<f32>,
- displayVisibleRectMax : vec2<u32>,
+ visibleSize : vec2<u32>,
plane1CoordFactor : vec2<f32>,
}
@@ -1965,7 +1965,7 @@
}
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
- let modifiedCoords = (params.coordTransformationMatrix * vec3<f32>(coord, 1));
+ let modifiedCoords = (params.sampleTransform * vec3<f32>(coord, 1));
let plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
var color : vec4<f32>;
if ((params.numPlanes == 1)) {
diff --git a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
index 25e0099..b79d036 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -44,8 +44,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
index 25e0099..b79d036 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -44,8 +44,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/bug/tint/1739.wgsl.expected.glsl b/test/tint/bug/tint/1739.wgsl.expected.glsl
index 81a11a5..1ebb2f4 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.glsl
+++ b/test/tint/bug/tint/1739.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -79,8 +79,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -99,7 +99,7 @@
uniform highp sampler2D t_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
void tint_symbol() {
diff --git a/test/tint/bug/tint/1739.wgsl.expected.msl b/test/tint/bug/tint/1739.wgsl.expected.msl
index 1be982b..115be5c 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.msl
+++ b/test/tint/bug/tint/1739.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -105,8 +105,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, int2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/bug/tint/1739.wgsl.expected.spvasm b/test/tint/bug/tint/1739.wgsl.expected.spvasm
index cefa1c1..baa7ad9 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1739.wgsl.expected.spvasm
@@ -28,17 +28,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %t "t"
@@ -59,13 +59,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/bug/tint/2076.wgsl.expected.glsl b/test/tint/bug/tint/2076.wgsl.expected.glsl
index 1bc2599..31b48a0 100644
--- a/test/tint/bug/tint/2076.wgsl.expected.glsl
+++ b/test/tint/bug/tint/2076.wgsl.expected.glsl
@@ -24,13 +24,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -43,17 +43,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
diff --git a/test/tint/bug/tint/2076.wgsl.expected.ir.spvasm b/test/tint/bug/tint/2076.wgsl.expected.ir.spvasm
index 4ae318c..4e6b604 100644
--- a/test/tint/bug/tint/2076.wgsl.expected.ir.spvasm
+++ b/test/tint/bug/tint/2076.wgsl.expected.ir.spvasm
@@ -27,17 +27,17 @@
OpMemberName %tint_ExternalTextureParams_std140 5 "gamutConversionMatrix_col0"
OpMemberName %tint_ExternalTextureParams_std140 6 "gamutConversionMatrix_col1"
OpMemberName %tint_ExternalTextureParams_std140 7 "gamutConversionMatrix_col2"
- OpMemberName %tint_ExternalTextureParams_std140 8 "coordTransformationMatrix_col0"
- OpMemberName %tint_ExternalTextureParams_std140 9 "coordTransformationMatrix_col1"
- OpMemberName %tint_ExternalTextureParams_std140 10 "coordTransformationMatrix_col2"
- OpMemberName %tint_ExternalTextureParams_std140 11 "loadTransformationMatrix_col0"
- OpMemberName %tint_ExternalTextureParams_std140 12 "loadTransformationMatrix_col1"
- OpMemberName %tint_ExternalTextureParams_std140 13 "loadTransformationMatrix_col2"
+ OpMemberName %tint_ExternalTextureParams_std140 8 "sampleTransform_col0"
+ OpMemberName %tint_ExternalTextureParams_std140 9 "sampleTransform_col1"
+ OpMemberName %tint_ExternalTextureParams_std140 10 "sampleTransform_col2"
+ OpMemberName %tint_ExternalTextureParams_std140 11 "loadTransform_col0"
+ OpMemberName %tint_ExternalTextureParams_std140 12 "loadTransform_col1"
+ OpMemberName %tint_ExternalTextureParams_std140 13 "loadTransform_col2"
OpMemberName %tint_ExternalTextureParams_std140 14 "samplePlane0RectMin"
OpMemberName %tint_ExternalTextureParams_std140 15 "samplePlane0RectMax"
OpMemberName %tint_ExternalTextureParams_std140 16 "samplePlane1RectMin"
OpMemberName %tint_ExternalTextureParams_std140 17 "samplePlane1RectMax"
- OpMemberName %tint_ExternalTextureParams_std140 18 "displayVisibleRectMax"
+ OpMemberName %tint_ExternalTextureParams_std140 18 "visibleSize"
OpMemberName %tint_ExternalTextureParams_std140 19 "plane1CoordFactor"
OpName %tint_ExternalTextureParams_std140 "tint_ExternalTextureParams_std140"
OpMemberName %tint_symbol_1_std140 0 "tint_symbol"
diff --git a/test/tint/bug/tint/2076.wgsl.expected.msl b/test/tint/bug/tint/2076.wgsl.expected.msl
index 7ae9727..3c3656a 100644
--- a/test/tint/bug/tint/2076.wgsl.expected.msl
+++ b/test/tint/bug/tint/2076.wgsl.expected.msl
@@ -36,13 +36,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -53,13 +53,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
diff --git a/test/tint/bug/tint/2076.wgsl.expected.spvasm b/test/tint/bug/tint/2076.wgsl.expected.spvasm
index 161110e..b16cceb 100644
--- a/test/tint/bug/tint/2076.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2076.wgsl.expected.spvasm
@@ -26,17 +26,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %Sampler "Sampler"
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
index e5fced1..f4d92ca 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -20,13 +20,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -39,17 +39,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -104,13 +104,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -123,17 +123,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -181,13 +181,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -200,17 +200,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
index d355023..559bfb4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -36,13 +36,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -53,13 +53,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
index 4c6b4fc..9152ae6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
index 48f6f39..1d20f4c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
index 48f6f39..1d20f4c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
index a0f7a8d..81bbeef 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -78,8 +78,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -98,7 +98,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -160,13 +160,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -179,17 +179,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -205,8 +205,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -225,7 +225,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -280,13 +280,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -299,17 +299,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -325,8 +325,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -345,7 +345,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
index f3cd398..ae6f4ff 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -101,8 +101,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
index 51f7059..c8e7799 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -61,13 +61,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
index 0e0fe5b..2127521 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
index 0e0fe5b..2127521 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
index 97f5adc..9dce3c8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -78,8 +78,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -98,7 +98,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -160,13 +160,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -179,17 +179,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -205,8 +205,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -225,7 +225,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -280,13 +280,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -299,17 +299,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -325,8 +325,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -345,7 +345,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
index 9ced0bb..a270fdd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -101,8 +101,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, int2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
index b4e4e50..44b9826 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -61,13 +61,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
index 2c9a2a8..2e1c77e 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
@@ -15,13 +15,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -40,7 +40,7 @@
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
- float2 modifiedCoords = mul(float3(coord, 1.0f), params.coordTransformationMatrix);
+ float2 modifiedCoords = mul(float3(coord, 1.0f), params.sampleTransform);
float2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
index 2c9a2a8..2e1c77e 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
@@ -15,13 +15,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -40,7 +40,7 @@
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
- float2 modifiedCoords = mul(float3(coord, 1.0f), params.coordTransformationMatrix);
+ float2 modifiedCoords = mul(float3(coord, 1.0f), params.sampleTransform);
float2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index cf582ef..d67cff6 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -25,13 +25,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -44,17 +44,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -71,7 +71,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -91,7 +91,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -145,13 +145,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -164,17 +164,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -191,7 +191,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -211,7 +211,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -258,13 +258,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -277,17 +277,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -304,7 +304,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -324,7 +324,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index c76c8fe..af90b98 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -97,7 +97,7 @@
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
- float2 const modifiedCoords = (params.coordTransformationMatrix * float3(coord, 1.0f));
+ float2 const modifiedCoords = (params.sampleTransform * float3(coord, 1.0f));
float2 const plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 24bb842..9b870c2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -60,13 +60,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
index e5fced1..f4d92ca 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -20,13 +20,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -39,17 +39,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -104,13 +104,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -123,17 +123,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -181,13 +181,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -200,17 +200,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
index d355023..559bfb4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -36,13 +36,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -53,13 +53,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
index 4c6b4fc..9152ae6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
index 28aaeda..b726be0 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
index 28aaeda..b726be0 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
index adff96e..0e7d5dd 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -78,8 +78,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -98,7 +98,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -161,13 +161,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -180,17 +180,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -206,8 +206,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -226,7 +226,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -282,13 +282,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -301,17 +301,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -327,8 +327,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, uvec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -347,7 +347,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
index c332ca8..e36fb2b 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -101,8 +101,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, uint2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
index 427c96e..a3022a5 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -61,13 +61,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
index 80a1aa9..37e4ac3 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
index 80a1aa9..37e4ac3 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
index b5cfb26..8d73dbf 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -78,8 +78,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -98,7 +98,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -161,13 +161,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -180,17 +180,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -206,8 +206,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -226,7 +226,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -282,13 +282,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -301,17 +301,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -327,8 +327,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -347,7 +347,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
index ceba81b..45e8bb2 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -101,8 +101,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, int2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
index 44a198b..4d6a909 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -61,13 +61,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
index bb93122..6b27178 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl
@@ -15,13 +15,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -40,7 +40,7 @@
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
- float2 modifiedCoords = mul(float3(coord, 1.0f), params.coordTransformationMatrix);
+ float2 modifiedCoords = mul(float3(coord, 1.0f), params.sampleTransform);
float2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
index bb93122..6b27178 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl
@@ -15,13 +15,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -40,7 +40,7 @@
}
float4 textureSampleExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, SamplerState smp, float2 coord, ExternalTextureParams params) {
- float2 modifiedCoords = mul(float3(coord, 1.0f), params.coordTransformationMatrix);
+ float2 modifiedCoords = mul(float3(coord, 1.0f), params.sampleTransform);
float2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
index 118b329..78cc5f9 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -25,13 +25,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -44,17 +44,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -71,7 +71,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -91,7 +91,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -146,13 +146,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -165,17 +165,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -192,7 +192,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -212,7 +212,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -260,13 +260,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -279,17 +279,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -306,7 +306,7 @@
vec4 textureSampleExternal(highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 modifiedCoords = (params.coordTransformationMatrix * vec3(coord, 1.0f));
+ vec2 modifiedCoords = (params.sampleTransform * vec3(coord, 1.0f));
vec2 plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
@@ -326,7 +326,7 @@
uniform highp sampler2D arg_0_arg_1;
uniform highp sampler2D ext_tex_plane_1_arg_1;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index 065f274..55b6945 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -97,7 +97,7 @@
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
- float2 const modifiedCoords = (params.coordTransformationMatrix * float3(coord, 1.0f));
+ float2 const modifiedCoords = (params.sampleTransform * float3(coord, 1.0f));
float2 const plane0_clamped = clamp(modifiedCoords, params.samplePlane0RectMin, params.samplePlane0RectMax);
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 1930c87..31a668c 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -60,13 +60,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureSampleExternal "textureSampleExternal"
OpName %plane0 "plane0"
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl
index 2014460..14bb4a9 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl
index 2014460..14bb4a9 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl
@@ -19,13 +19,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -43,8 +43,8 @@
}
float4 textureLoadExternal(Texture2D<float4> plane0, Texture2D<float4> plane1, int2 coord, ExternalTextureParams params) {
- uint2 clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransformationMatrix)));
+ uint2 clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 plane0_clamped = tint_ftou(round(mul(float3(float2(clampedCoords), 1.0f), params.loadTransform)));
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = plane0.Load(uint3(plane0_clamped, uint(0))).rgba;
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
index e52054d..9e1e629 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.glsl
@@ -33,13 +33,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -52,17 +52,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -78,8 +78,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -102,7 +102,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
void doTextureLoad() {
@@ -159,13 +159,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -178,17 +178,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -204,8 +204,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -228,7 +228,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
void doTextureLoad() {
@@ -278,13 +278,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- mat3x2 coordTransformationMatrix;
- mat3x2 loadTransformationMatrix;
+ mat3x2 sampleTransform;
+ mat3x2 loadTransform;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -297,17 +297,17 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
mat3 gamutConversionMatrix;
- vec2 coordTransformationMatrix_0;
- vec2 coordTransformationMatrix_1;
- vec2 coordTransformationMatrix_2;
- vec2 loadTransformationMatrix_0;
- vec2 loadTransformationMatrix_1;
- vec2 loadTransformationMatrix_2;
+ vec2 sampleTransform_0;
+ vec2 sampleTransform_1;
+ vec2 sampleTransform_2;
+ vec2 loadTransform_0;
+ vec2 loadTransform_1;
+ vec2 loadTransform_2;
vec2 samplePlane0RectMin;
vec2 samplePlane0RectMax;
vec2 samplePlane1RectMin;
vec2 samplePlane1RectMax;
- uvec2 displayVisibleRectMax;
+ uvec2 visibleSize;
vec2 plane1CoordFactor;
};
@@ -323,8 +323,8 @@
}
vec4 textureLoadExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, ivec2 coord, ExternalTextureParams params) {
- uvec2 clampedCoords = min(uvec2(coord), params.displayVisibleRectMax);
- uvec2 plane0_clamped = tint_ftou(round((params.loadTransformationMatrix * vec3(vec2(clampedCoords), 1.0f))));
+ uvec2 clampedCoords = min(uvec2(coord), params.visibleSize);
+ uvec2 plane0_clamped = tint_ftou(round((params.loadTransform * vec3(vec2(clampedCoords), 1.0f))));
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
if ((params.numPlanes == 1u)) {
color = texelFetch(plane0_1, ivec2(plane0_clamped), 0).rgba;
@@ -347,7 +347,7 @@
uniform highp sampler2D arg_0_1;
uniform highp sampler2D ext_tex_plane_1_2;
ExternalTextureParams conv_ExternalTextureParams(ExternalTextureParams_std140 val) {
- return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.coordTransformationMatrix_0, val.coordTransformationMatrix_1, val.coordTransformationMatrix_2), mat3x2(val.loadTransformationMatrix_0, val.loadTransformationMatrix_1, val.loadTransformationMatrix_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.displayVisibleRectMax, val.plane1CoordFactor);
+ return ExternalTextureParams(val.numPlanes, val.doYuvToRgbConversionOnly, val.pad, val.pad_1, val.yuvToRgbConversionMatrix, val.gammaDecodeParams, val.gammaEncodeParams, val.gamutConversionMatrix, mat3x2(val.sampleTransform_0, val.sampleTransform_1, val.sampleTransform_2), mat3x2(val.loadTransform_0, val.loadTransform_1, val.loadTransform_2), val.samplePlane0RectMin, val.samplePlane0RectMax, val.samplePlane1RectMin, val.samplePlane1RectMax, val.visibleSize, val.plane1CoordFactor);
}
void doTextureLoad() {
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
index 58e53df..bb70249 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
@@ -38,13 +38,13 @@
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
/* 0x0080 */ tint_array<tint_packed_vec3_f32_array_element, 3> gamutConversionMatrix;
- /* 0x00b0 */ float3x2 coordTransformationMatrix;
- /* 0x00c8 */ float3x2 loadTransformationMatrix;
+ /* 0x00b0 */ float3x2 sampleTransform;
+ /* 0x00c8 */ float3x2 loadTransform;
/* 0x00e0 */ float2 samplePlane0RectMin;
/* 0x00e8 */ float2 samplePlane0RectMax;
/* 0x00f0 */ float2 samplePlane1RectMin;
/* 0x00f8 */ float2 samplePlane1RectMax;
- /* 0x0100 */ uint2 displayVisibleRectMax;
+ /* 0x0100 */ uint2 visibleSize;
/* 0x0108 */ float2 plane1CoordFactor;
};
@@ -60,13 +60,13 @@
GammaTransferParams gammaDecodeParams;
GammaTransferParams gammaEncodeParams;
float3x3 gamutConversionMatrix;
- float3x2 coordTransformationMatrix;
- float3x2 loadTransformationMatrix;
+ float3x2 sampleTransform;
+ float3x2 loadTransform;
float2 samplePlane0RectMin;
float2 samplePlane0RectMax;
float2 samplePlane1RectMin;
float2 samplePlane1RectMax;
- uint2 displayVisibleRectMax;
+ uint2 visibleSize;
float2 plane1CoordFactor;
};
@@ -78,13 +78,13 @@
result.gammaDecodeParams = in.gammaDecodeParams;
result.gammaEncodeParams = in.gammaEncodeParams;
result.gamutConversionMatrix = tint_unpack_vec3_in_composite(in.gamutConversionMatrix);
- result.coordTransformationMatrix = in.coordTransformationMatrix;
- result.loadTransformationMatrix = in.loadTransformationMatrix;
+ result.sampleTransform = in.sampleTransform;
+ result.loadTransform = in.loadTransform;
result.samplePlane0RectMin = in.samplePlane0RectMin;
result.samplePlane0RectMax = in.samplePlane0RectMax;
result.samplePlane1RectMin = in.samplePlane1RectMin;
result.samplePlane1RectMax = in.samplePlane1RectMax;
- result.displayVisibleRectMax = in.displayVisibleRectMax;
+ result.visibleSize = in.visibleSize;
result.plane1CoordFactor = in.plane1CoordFactor;
return result;
}
@@ -101,8 +101,8 @@
}
float4 textureLoadExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, int2 coord, ExternalTextureParams params) {
- uint2 const clampedCoords = min(uint2(coord), params.displayVisibleRectMax);
- uint2 const plane0_clamped = tint_ftou(rint((params.loadTransformationMatrix * float3(float2(clampedCoords), 1.0f))));
+ uint2 const clampedCoords = min(uint2(coord), params.visibleSize);
+ uint2 const plane0_clamped = tint_ftou(rint((params.loadTransform * float3(float2(clampedCoords), 1.0f))));
float4 color = 0.0f;
if ((params.numPlanes == 1u)) {
color = plane0.read(uint2(plane0_clamped), 0).rgba;
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
index cdb2477..38b76f3 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
@@ -32,17 +32,17 @@
OpMemberName %GammaTransferParams 7 "padding"
OpMemberName %ExternalTextureParams_std140 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams_std140 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams_std140 6 "coordTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 7 "coordTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 8 "coordTransformationMatrix_2"
- OpMemberName %ExternalTextureParams_std140 9 "loadTransformationMatrix_0"
- OpMemberName %ExternalTextureParams_std140 10 "loadTransformationMatrix_1"
- OpMemberName %ExternalTextureParams_std140 11 "loadTransformationMatrix_2"
+ OpMemberName %ExternalTextureParams_std140 6 "sampleTransform_0"
+ OpMemberName %ExternalTextureParams_std140 7 "sampleTransform_1"
+ OpMemberName %ExternalTextureParams_std140 8 "sampleTransform_2"
+ OpMemberName %ExternalTextureParams_std140 9 "loadTransform_0"
+ OpMemberName %ExternalTextureParams_std140 10 "loadTransform_1"
+ OpMemberName %ExternalTextureParams_std140 11 "loadTransform_2"
OpMemberName %ExternalTextureParams_std140 12 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams_std140 13 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams_std140 14 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams_std140 15 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams_std140 16 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams_std140 16 "visibleSize"
OpMemberName %ExternalTextureParams_std140 17 "plane1CoordFactor"
OpName %ext_tex_params "ext_tex_params"
OpName %arg_0 "arg_0"
@@ -58,13 +58,13 @@
OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpMemberName %ExternalTextureParams 6 "coordTransformationMatrix"
- OpMemberName %ExternalTextureParams 7 "loadTransformationMatrix"
+ OpMemberName %ExternalTextureParams 6 "sampleTransform"
+ OpMemberName %ExternalTextureParams 7 "loadTransform"
OpMemberName %ExternalTextureParams 8 "samplePlane0RectMin"
OpMemberName %ExternalTextureParams 9 "samplePlane0RectMax"
OpMemberName %ExternalTextureParams 10 "samplePlane1RectMin"
OpMemberName %ExternalTextureParams 11 "samplePlane1RectMax"
- OpMemberName %ExternalTextureParams 12 "displayVisibleRectMax"
+ OpMemberName %ExternalTextureParams 12 "visibleSize"
OpMemberName %ExternalTextureParams 13 "plane1CoordFactor"
OpName %textureLoadExternal "textureLoadExternal"
OpName %plane0 "plane0"